X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 709A53A3EFD for ; Sat, 6 Nov 2004 01:54:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31858-04 for ; Sat, 6 Nov 2004 01:54:03 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id A0D8F3A3F10 for ; Sat, 6 Nov 2004 01:54:06 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id iA61s2J7032419 for ; Sat, 6 Nov 2004 01:54:02 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id iA61eYjp029746 for pgsql-php@postgresql.org; Sat, 6 Nov 2004 01:40:34 GMT From: ljb X-Newsgroups: comp.databases.postgresql.interfaces.php Subject: Re: sql problem with php Date: Sat, 6 Nov 2004 01:40:34 +0000 (UTC) Organization: Hub.Org Networking Services Lines: 16 Message-ID: References: <200411051233.10080.ff@dr.ufu.br> X-Complaints-To: usenet@news.hub.org User-Agent: slrn/0.9.8.0 (Linux) To: pgsql-php@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.9 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS X-Spam-Level: X-Archive-Number: 200411/2 X-Sequence-Number: 2946 ff@dr.ufu.br wrote: > Hi, > > I am having a problem with a system I developed using php with postgres. >... > > I am not able to get a error_number in pgsql errors, only the error message. > So when I used pgsql 7.3 a used the string "referential integrity violation" > to detect this error, but on version 7.4 of pgsql this string was replaced > with "violates foreign key constraint" . > Anyone has a definitive solution on this or the way is to wait and change all > my code on future releases of pgsql? Unfortunately this is a limitation of the PHP PostgreSQL extension. PostgreSQL provids access to error numbers (I think as of 7.4) through libpq PQerrorField(), but PHP doesn't give you access to this yet.