pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <xzilla@users.sourceforge.net>
To: ljb <ljb220@mindspring.com>
Cc: pgsql-php@postgresql.org
Subject: Re: sql problem with php
Date: Sat, 6 Nov 2004 10:37:49 -0500
Message-ID: <200411061037.49469.xzilla@users.sourceforge.net> (raw)
In-Reply-To: <cmha2i$rjt$1@news.hub.org>
References: <200411051233.10080.ff@dr.ufu.br>
	<cmha2i$rjt$1@news.hub.org>

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



view thread (4+ messages)  latest in thread

Message-ID: <200411061037.49469.xzilla@users.sourceforge.net>
Permalink:  ../200411061037.49469.xzilla@users.sourceforge.net/
Also on:    postgresql.org/message-id/200411061037.49469.xzilla@users.sourceforge.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: xzilla@users.sourceforge.net, ljb220@mindspring.com
  Subject: Re: sql problem with php
  In-Reply-To: <200411061037.49469.xzilla@users.sourceforge.net>
  References: <200411051233.10080.ff@dr.ufu.br> <cmha2i$rjt$1@news.hub.org> <200411061037.49469.xzilla@users.sourceforge.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox