Skip site navigation (1) Skip section navigation (2)

PgSQL error codes in PHP

From: Dawid Ferenczy <ferenczy(at)volny(dot)cz>
To: pgsql-php(at)postgresql(dot)org
Subject: PgSQL error codes in PHP
Date: 2004-11-12 13:01:11
Message-ID: 4194B417.9020206@volny.cz (view raw or flat)
Thread:
Lists: pgsql-php
Hi,

   I need help, please - I tried Google, some specialized mailinglist
and I got no result for a week. I would like to determine PgSQL error
codes in PHP after executing a query, but I found functions for getting
error messages only which I found not usable (messages are often
localised and so on). On PHP manual pages is for that reason some patch,
but only for PHP 4.x and with broken link ;) I need solution in PHP 5.

  For example:

  'CREATE TABLE xxx;'

  If table already exists, PgSQL return error message "Relation xxx
already exists" or "Relace xxx jiz existuje" in czech language and (not
in UTF-8 coding ;)

  So now, I know that some error occurs but I cannot determine cause :(
(compare error messages is nonsense).

  If I'll not find relevant solution, I'm going to write this function
in PgSQL extension (oh my God!!! [I'm atheist ;) ])

  Sorry for my english, it isn't my strong side, if you want I'll
welcome some language corrections ;)

  Thanx a lot, you are my last chance before I'll go to write my own
implementation...

-- 
 Dawid Ferenczy
 http://xcoder.jinak.cz
 ICQ: 85997864


Responses

pgsql-php by date

Next:From: Thom DysonDate: 2004-11-12 16:00:08
Subject: Re: PgSQL error codes in PHP
Previous:From: Szűcs GáborDate: 2004-11-11 22:11:18
Subject: Re: [Plphp] Re: plPHP and PostgreSQL 7.4.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group