Re: How to get last Error Message/Code

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: How to get last Error Message/Code
Дата
Msg-id 4E3A4249.4090202@hogranch.com
обсуждение исходный текст
Ответ на How to get last Error Message/Code  (Earth Analizer <analizer1@gmail.com>)
Список pgsql-general
On 08/03/11 10:03 PM, Earth Analizer wrote:
> Hi,
>
> I am new to Postgres and I would like to know how I can get the last
> error message.
> I am using a programming language called "Paradox" and, when an error
> occurs,
> it converts the Postgres error code to its own error code.
> Sometimes Paradox displays a funny message, if it does not recognize
> the code and
> the error message it displays gives me no clue for what actually happened.
>
> if anyone knows the solution, please let me know.
>
> Thank you in advance.
> Cheers!

any SQL errors should be in postgres' logfile, which typically is
accessible only to the postgres user, in the pg data/pg_log directory

I usually like to make a few tweaks to the logging defaults, like


     log_line_prefix = '%m %u@%d[%p]:'

which will timestamp the logs, and give you user@database[pid]: in front
of each entry, like...

2011-08-04 02:06:46.681 PDT postgres@postgres[12927]:ERROR:  column
"junk" does not exist at character 8
2011-08-04 02:06:46.681 PDT postgres@postgres[12927]:STATEMENT:  select
junk;


--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


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

Предыдущее
От: Earth Analizer
Дата:
Сообщение: How to get last Error Message/Code
Следующее
От: Adarsh Sharma
Дата:
Сообщение: Re: Server Not Running