Lists: | pgsql-general |
---|
From: | "Amit Khare" <khare(at)uiuc(dot)edu> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | How to Run postgres inside gdb for debugging |
Date: | 2002-02-21 23:07:27 |
Message-ID: | 82fd8.21972$tg4.250399@vixen.cso.uiuc.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hi All,
Can any one help me running postgres inside gdb for debugging ?
Thanks and Regards
Amit Khare
From: | Lee Kindness <lkindness(at)csl(dot)co(dot)uk> |
---|---|
To: | "Amit Khare" <khare(at)uiuc(dot)edu> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | How to Run postgres inside gdb for debugging |
Date: | 2002-02-22 14:15:14 |
Message-ID: | 15478.21106.606877.673112@kelvin.csl.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Amit Khare writes:
> Can any one help me running postgres inside gdb for debugging ?
The short answer is you need to tell gdb to connect to the backend
'postmaster' process which has been started for your connection - you
should able to work out its pid using ps (or more likely a simple list
in your debugger frontend).
The problem is you'll need to do this very fast - this is why postgres
has a '-W' option to tell the process to wait a defined time before
really starting up - giving you time to connect. See:
http://www.geocrawler.com/archives/3/10/1999/4/0/1649841/
Lee.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Lee Kindness <lkindness(at)csl(dot)co(dot)uk> |
Cc: | "Amit Khare" <khare(at)uiuc(dot)edu>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: How to Run postgres inside gdb for debugging |
Date: | 2002-02-23 19:01:11 |
Message-ID: | 25647.1014490871@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Lee Kindness <lkindness(at)csl(dot)co(dot)uk> writes:
> The problem is you'll need to do this very fast - this is why postgres
> has a '-W' option to tell the process to wait a defined time before
> really starting up - giving you time to connect. See:
> http://www.geocrawler.com/archives/3/10/1999/4/0/1649841/
It's not necessary to use -W unless you are trying to debug something
that happens during the backend startup process. Even then, I wouldn't
make it a postmaster parameter, because that causes *all* started
backends to delay. Instead say export PGOPTIONS="-W n" on the client
side before you start psql, so the delay only applies to your backend
under test. See
http://archives.postgresql.org/pgsql-hackers/2000-01/msg01463.php
(Bruce said he was going to put that info into FAQ_DEV, but he never
did...)
regards, tom lane
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: | Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, Amit Khare <khare(at)uiuc(dot)edu>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: How to Run postgres inside gdb for debugging |
Date: | 2002-02-23 20:11:44 |
Message-ID: | 200202232011.g1NKBiU02149@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Tom Lane wrote:
> Lee Kindness <lkindness(at)csl(dot)co(dot)uk> writes:
> > The problem is you'll need to do this very fast - this is why postgres
> > has a '-W' option to tell the process to wait a defined time before
> > really starting up - giving you time to connect. See:
>
> > http://www.geocrawler.com/archives/3/10/1999/4/0/1649841/
>
> It's not necessary to use -W unless you are trying to debug something
> that happens during the backend startup process. Even then, I wouldn't
> make it a postmaster parameter, because that causes *all* started
> backends to delay. Instead say export PGOPTIONS="-W n" on the client
> side before you start psql, so the delay only applies to your backend
> under test. See
>
> http://archives.postgresql.org/pgsql-hackers/2000-01/msg01463.php
>
> (Bruce said he was going to put that info into FAQ_DEV, but he never
> did...)
It is in the main FAQ already.
--
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