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 1EBEE3A4139 for ; Sat, 6 Nov 2004 15:39:21 +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 93571-02 for ; Sat, 6 Nov 2004 15:39:11 +0000 (GMT) Received: from lakermmtao07.cox.net (lakermmtao07.cox.net [68.230.240.32]) by svr1.postgresql.org (Postfix) with ESMTP id 49A8F3A413D for ; Sat, 6 Nov 2004 15:39:14 +0000 (GMT) Received: from [192.168.0.9] (really [24.136.36.194]) by lakermmtao07.cox.net (InterMail vM.6.01.03.04 201-2131-111-106-20040729) with ESMTP id <20041106153914.HNBE20686.lakermmtao07.cox.net@[192.168.0.9]>; Sat, 6 Nov 2004 10:39:14 -0500 From: Robert Treat To: ljb Subject: Re: sql problem with php Date: Sat, 6 Nov 2004 10:37:49 -0500 User-Agent: KMail/1.6.2 Cc: pgsql-php@postgresql.org References: <200411051233.10080.ff@dr.ufu.br> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200411061037.49469.xzilla@users.sourceforge.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/3 X-Sequence-Number: 2947 On Friday 05 November 2004 20:40, ljb wrote: > 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. > Actually I believe you can get it: http://us2.php.net/manual/en/function.pg-result-error.php though this will only work in pg74 or greater. -- Robert Treat Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL