Re: newbie debugging pl/pgsql : better way?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: newbie debugging pl/pgsql : better way?
Дата
Msg-id 27508.972456512@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: newbie debugging pl/pgsql : better way?  (Ashley Clark <aclark@ghoti.org>)
Список pgsql-general
Ashley Clark <aclark@ghoti.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problems with genetic optimizer
Следующее
От: Peter Keller
Дата:
Сообщение: Re: Problems with genetic optimizer