I am using PostgreSQL 9.2 and it runs automatically when I start the system (Kubuntu).
How can I avoid this?
I need to start it manually, and I don't want it to start unattended because I need to look at the console.
Ubuntu or Debian can run multiple instances of PostgreSQL and provide a specific way to autostart/stop/start each cluster.
There should be a file named
# Automatic startup configuration # auto: automatically start/stop the cluster in the init script # manual: do not start/stop in init scripts, but allow manual startup with # pg_ctlcluster # disabled: do not allow manual startup with pg_ctlcluster (this can be easily # circumvented and is only meant to be a small protection for # accidents). auto
If you replace auto by manual, you could start this PostgreSQL instance only when desired with the command:
As for looking at the console, what you should want instead is having this run in a terminal when you work with the database:
The command /usr/sbin/update-rc.d is used to start, stop, enable, or disable services.
Type "man update-rc.d" to familiarize yourself with the command and its parameters.
Then type something along the lines of "sudo update-rc.d disable [service]" for any service listed in your /etc/init.d/ directory. That will prevent [service] from starting at boot. If you also want to shut down the service immediately, try "sudo update-rc.d stop [service]"
you probably do not need to run postgresql manually in order to see its console output. You just need to log that output, and tail the log file.