Re: newbie debugging pl/pgsql : better way?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ashley Clark <aclark(at)ghoti(dot)org>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: newbie debugging pl/pgsql : better way?
Date: 2000-10-25 06:48:32
Message-ID: 27508.972456512@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ashley Clark <aclark(at)ghoti(dot)org> writes:
>> Is there a better way to debug pl/pgsql functions?

> If you find it let me know.

The postmaster log should have useful tidbits. Make sure there *is*
a postmaster log --- start the postmaster without -S, and with its
stdout and stderr directed into a logfile in some handy place.

Then run the misbehaving application with debug options set to -d2
or higher, eg
export PGOPTIONS="-d2"
psql mydb
mydb> -- do your worst here

The log will show the primitive SQL queries generated by plpgsql
functions, as well as the error messages from them. This is usually
a large leg up on figuring out the problem. If you're still stuck,
post the plpgsql function body and the relevant logfile section on
the pgsql mail lists, and someone will probably be able to help.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Keller 2000-10-25 07:18:19 Re: Problems with genetic optimizer
Previous Message Tom Lane 2000-10-25 06:26:28 Re: Problems with genetic optimizer