Chris Bitmead <chrisb@nimrod.itg.telstra.com.au> writes:
> Is there any particular reason why a backend has to be started by the
> postmaster unless it is the only backend running (in debug mode) ?
If you don't have a postmaster then the backend is running standalone,
which is not really the same environment as running in a live
installation. It's OK for some kinds of debugging but I wouldn't
trust it an inch for locking or resource-related issues.
> (a) It would be more convenient to debug if you didn't have to shut down
> the postmaster to run gdb postgres and...
Say what? I've never yet shut down the postmaster to gdb anything;
I tell gdb to "attach" to a running backend started by the postmaster.
(See thread a couple weeks ago on exactly this point.) The major
advantage of that way of working is you can use a reasonable client
(psql or whatever floats your boat) instead of having to type queries
directly at a backend that has no input-editing or command history
support. There's also no question about whether you're running in
a realistic environment or not. Finally, you can fire up an additional
client+backend to examine the database even when you've got the backend
under test stopped somewhere (so long as it's not stopped holding a
spinlock or anything like that). If it weren't for the needs of initdb,
I think standalone-backend mode would've gone the way of the dodo
some time ago...
regards, tom lane