Re: Need a debugging tip or two

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, "Kevin O'Gorman" <kogorman(at)pacbell(dot)net>, PGSQL Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Need a debugging tip or two
Date: 2001-01-22 06:35:28
Message-ID: 200101220635.BAA23115@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I see the mention of -w in the main FAQ.

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > There's probably little reason to start a backend standalone. If you want
> > to do stock-of-the-trade debugging you simply start a postmaster, then
> > psql (or whatever floats your boat), and attach gdb to the resulting
> > backend process.
>
> Right, that's what I always do (unless I have to debug a crash at initdb
> time :-(). A tip here is that you can even debug backend-startup-time
> problems this way, and no you don't have to be superhumanly quick on the
> trigger: you set PGOPTIONS="-W n" in the environment of psql. This
> will cause an n-second sleep() call very early in the backend startup
> process. I find 30 seconds plenty of time to run ps, start gdb, and
> attach. You can also throw in things like "-d2" to crank up the
> postmaster log level for just the backend under test.
>
> I thought this lore was in the developer's FAQ already, but I don't
> see it there at the moment. Bruce, is it lurking someplace else?
>
> regards, tom lane
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christof Petig 2001-01-22 07:51:33 Re: [PATCHES] Small patch to replace 'idle' by 'trans' if transactionis still open
Previous Message Zachary Beane 2001-01-22 04:01:04 Re: 'enum' equivalent?