how do I install postgis2.0 under win 7 to run just on demand. I dont want to run it permanently as a service. Similary as the (nonspatial) mysql can be run on demand via the xampp-tools (http://www.apachefriends.org/de/xampp.html)
Go to Control Panel > Administrative Tools > Services.
Scroll down the list of services to something like "postgresql-x64-9.1", and double-click it (or inspect it's properties). Change startup type from "Automatic" to "Manual". Now you take control of the "start"/"stop".
If you want to turn PostgreSQL (and PostGIS) "on" or "off", you would need to open this Services dialog, find and select the service and press the "Start Service" button (looks like a "play" button for music players), or press the "Stop Service" button to turn it off.
(Older versions of PostgreSQL used to have some convenient icons in the Start menu to "start"/"stop" this service. I'm sure it wouldn't be too difficult to recreate these icons of convenience if really needed.)
Honestly, this will annoy you more than it will help spare your system's resources. Unless you've tuned your PostgreSQL database, the default resource settings are pretty low. If you inspect your Resource Monitor, you will probably see about 10
you always can install PostgreSQL as a service in windows, and start/stop it manually from windows service console.
To clarify, XAMPP doesn't run MySQL "on demand", per se, but rather wraps everything in a control panel that allows you to quickly start and stop the service.
That said, if what you want is control over a PostGreSQL service (with PostGIS installed) in the same fashion as MySQL in XAMPP, there does appear to be a way to add PostGreSQL support directly to XAMPP. A few links:
http://notepad.patheticcockroach.com/628/adding-postgresql-portable-to-xampp-on-windows/ http://www.compuforums.org/website-development/3502-xampp-postgresql-windows-xp.html http://practicalfoss.blogspot.com/2008/09/how-to-install-postgresql-and.html
I have not done this myself, so I could not tell you how much success you're likely to have.