Re: ODBC and Native error codes

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Andy Hallam <ahm(at)exel(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ODBC and Native error codes
Date: 2001-11-08 00:58:36
Message-ID: 3BE9D8BC.B83C2D77@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

Please post this to pgsql-odbc list.
Unfortunately PostgreSQL doesn't have error code
currently and so psqlodbc doesn't return any valid
Native error code.

regards,
Hiroshi Inoue

Andy Hallam wrote:
>
> PostgreSQL - 7.1.3 (installed on Linux 2.4.2-2)
> PSQLODBC.DLL - 07.01.0007
> Visual C++ - 6.0
>
> PostgreSQL does not return the standard ANSI Native SQL number through
> SQLGetDiagRec().
>
> I.e
>
> 1) - Select from a table that does not exist.
>
> ANSI Native sql code is -208
> SQL SERVER returns -208
> DB2 returns -204
> ORACLE returns -942
> PostgreSQL returns -7
>
> 2) - Select a column that does not exist on a valid table.
>
> ANSI Native sql code is -207
> SQL SERVER returns -207
> DB2 returns -206
> ORACLE returns -904
> PostgreSQL returns -7
>
> 3) - Referential integrity violated.
>
> -547 = Reference or constraint violated
> -2627 = Primary key violated
> -2601 = Duplicate key row
> PostgreSQL returns -7 for all the above scenarios ?
>
> Infact, PostgreSQL only ever return -7 !!!
>
> OK - PostgreSQL (Like all the other Database vendors above) does return an
> informative string, but it should also return the correct Native ANSI SQL
> number.
>
> Anyone know of a way to retreive this Native SQL number?
>
> Andy
> ahm(at)exel(dot)co(dot)uk
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message GB Clark II 2001-11-08 01:08:14 small problem updating to 7.2...
Previous Message Peter Eisentraut 2001-11-08 00:25:51 Re: pg_restore

Browse pgsql-odbc by date

  From Date Subject
Next Message Mike Miller 2001-11-08 01:50:00 Re: ODBC & Transactions?
Previous Message Hiroshi Inoue 2001-11-08 00:47:00 Re: ODBC & Transactions?