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 C8F153A4A4A for ; Sat, 13 Nov 2004 13:41:38 +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 77546-01 for ; Sat, 13 Nov 2004 13:41:26 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 5ECBB3A46D8 for ; Sat, 13 Nov 2004 13:41:27 +0000 (GMT) Received: from localhost (dsl-082-082-202-156.arcor-ip.net [82.82.202.156]) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id iADDfJX03429; Sat, 13 Nov 2004 14:41:19 +0100 Subject: Re: PgSQL error codes in PHP From: Markus Bertheau To: Dawid Ferenczy Cc: pgsql-php@postgresql.org In-Reply-To: <4194B417.9020206@volny.cz> References: <4194B417.9020206@volny.cz> Content-Type: text/plain; charset=utf-8 Date: Sat, 13 Nov 2004 14:41:25 +0100 Message-Id: <1100353285.3304.2.camel@fc3> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 8bit 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/10 X-Sequence-Number: 2954 Here's a patch for getting the sqlstate for PHP5. It should apply to PHP4 without problems: http://marc.theaimsgroup.com/?l=php-dev&m=109991803204873&w=2 В Птн, 12/11/2004 в 14:01 +0100, Dawid Ferenczy пишет: > 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... > -- Markus Bertheau