Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 072A4632201 for ; Tue, 22 Sep 2009 10:38:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 43516-02 for ; Tue, 22 Sep 2009 13:38:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mail.postgresql.org (Postfix) with ESMTP id 18603633066 for ; Tue, 22 Sep 2009 10:38:18 -0300 (ADT) Received: from localhost (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id 136D1EBC3F; Tue, 22 Sep 2009 09:38:16 -0400 (EDT) Date: Tue, 22 Sep 2009 09:38:15 -0400 From: Bill Moran To: Gustavo Amarilla Santacruz Cc: pgsql-php@postgresql.org Subject: Re: Error code Message-Id: <20090922093815.7b8ae05f.wmoran@potentialtech.com> In-Reply-To: References: <4AB821BD.6070508@gmail.com> Organization: Bill Moran X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.5; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.74 tagged_above=-10 required=5 tests=BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 200909/18 X-Sequence-Number: 4076 In response to Gustavo Amarilla Santacruz : > Thank you, Chris. > Now, I need to do this in PHP: > > -------------------- CODE > --------------------------------------------------------------- > > $errorCode = pg_result_error_field($res1, PGSQL_DIAG_SQLSTATE) ; > > if( $errorCode == UNIQUE_VIOLATION ) if ( $errorCode == '23505' ) -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/