PostgreSQL PHP & Error handling

From: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>
To: "postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: PostgreSQL PHP & Error handling
Date: 2003-04-25 10:23:55
Message-ID: 01d901c30b14$c682d3e0$aa0f5ac2@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All

Continuing my research of Serializable transaction I wanted to conduct a
test of running two querys expecting that the second query will return:
"ERROR: Can't serialize access due to concurrent update"

The only way I could check what is the last error was pg_last_error( $conn )
while it seems that pg_result_error( $res ) & pg_result_status( $res )
should be more reliable as they use the query result resource.

But the main problem is that pg_query() return false on error so I cant use
the returned value what make the little useless :(

any one know some other way to intercept errors ?

--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://sites.canaan.co.il
--------------------------

Browse pgsql-general by date

  From Date Subject
Next Message pginfo 2003-04-25 10:46:33 Re: Fwd: Unicode, RedHat Linux, & PostgreSQL
Previous Message Richard Huxton 2003-04-25 08:38:50 Re: Help with a query