Re: Error Codes?
От | Martijn van Oosterhout |
---|---|
Тема | Re: Error Codes? |
Дата | |
Msg-id | 20011011110501.A21264@svana.org обсуждение исходный текст |
Ответ на | Re: Error Codes? (Fran Fabrizio <ffabrizio@mmrd.com>) |
Список | pgsql-general |
On Wed, Oct 10, 2001 at 05:41:37PM -0400, Fran Fabrizio wrote: > > Rob Arnold wrote: > > > > > Look at $db->errstr That has the text version of the error code. > > > > > > --rob > > Yes, but I want to know about the codes, not the text. If the codes exist, > they are easier to work with than the text. I find this code useful. You can build a hash from which you can extract more useful error messages. perl -MPg <<'EOF' print map { "$_ => ".$Pg::{$_}->()."\n" } sort grep { /^PGRES_/ } keys %Pg:: EOF === output === PGRES_BAD_RESPONSE => 5 PGRES_COMMAND_OK => 1 PGRES_CONNECTION_BAD => 1 PGRES_CONNECTION_OK => 0 PGRES_COPY_IN => 4 PGRES_COPY_OUT => 3 PGRES_EMPTY_QUERY => 0 PGRES_FATAL_ERROR => 7 PGRES_INV_ARCHIVE => 65536 PGRES_INV_READ => 262144 PGRES_INV_SMGRMASK => 65535 PGRES_INV_WRITE => 131072 PGRES_InvalidOid => 0 PGRES_NONFATAL_ERROR => 6 PGRES_TUPLES_OK => 2 ================ > > -Fran > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Magnetism, electricity and motion are like a three-for-two special offer: > if you have two of them, the third one comes free.
В списке pgsql-general по дате отправления: