pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedDedect unknown database in 08.01.0100 and Postgres 8.1
5+ messages / 4 participants
[nested] [flat]
* Dedect unknown database in 08.01.0100 and Postgres 8.1
@ 2005-11-08 18:26 Andrus <eetasoft@online.ee>
0 siblings, 1 reply; 5+ messages in thread
From: Andrus @ 2005-11-08 18:26 UTC (permalink / raw)
To: pgsql-odbc
I need to dedect the case where database specified in connection string does
not exist.
Earlier odbc driver with Postgres 8.0 returns special error text in this
case:
FATAL: database "foo" does not exist
New ODBC driver with Postgres 8.1 returns the same error in all cases:
Could not connect to the server
How to determine is this error caused by non-existing database in cluster or
by other cause ?
Andrus
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Dedect unknown database in 08.01.0100 and Postgres 8.1
@ 2005-11-08 19:02 Tom Lane <tgl@sss.pgh.pa.us>
parent: Andrus <eetasoft@online.ee>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2005-11-08 19:02 UTC (permalink / raw)
To: Andrus <eetasoft@online.ee>; +Cc: pgsql-odbc
"Andrus" <eetasoft@online.ee> writes:
> Earlier odbc driver with Postgres 8.0 returns special error text in this
> case:
> FATAL: database "foo" does not exist
> New ODBC driver with Postgres 8.1 returns the same error in all cases:
> Could not connect to the server
This seems like a serious regression in behavior. Why isn't the driver
returning the error string provided by libpq?
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Dedect unknown database in 08.01.0100 and Postgres 8.1
@ 2005-11-08 20:00 me@alternize.com
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: me@alternize.com @ 2005-11-08 20:00 UTC (permalink / raw)
To: Andrus <eetasoft@online.ee>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-odbc
confirmed here: if you specify wrong account or password in the connection
string, all the odbc driver (unicode version) returns is "Could not connect
to the server"
cheers,
thomas
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Andrus" <eetasoft@online.ee>
Cc: <pgsql-odbc@postgresql.org>
Sent: Tuesday, November 08, 2005 8:02 PM
Subject: Re: [ODBC] Dedect unknown database in 08.01.0100 and Postgres 8.1
> "Andrus" <eetasoft@online.ee> writes:
>> Earlier odbc driver with Postgres 8.0 returns special error text in this
>> case:
>> FATAL: database "foo" does not exist
>
>> New ODBC driver with Postgres 8.1 returns the same error in all cases:
>> Could not connect to the server
>
> This seems like a serious regression in behavior. Why isn't the driver
> returning the error string provided by libpq?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Dedect unknown database in 08.01.0100 and Postgres 8.1
@ 2005-11-09 09:43 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 5+ messages in thread
From: Dave Page @ 2005-11-09 09:43 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Andrus <eetasoft@online.ee>; +Cc: pgsql-odbc
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Tom Lane
> Sent: 08 November 2005 19:02
> To: Andrus
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Dedect unknown database in 08.01.0100 and
> Postgres 8.1
>
> "Andrus" <eetasoft@online.ee> writes:
> > Earlier odbc driver with Postgres 8.0 returns special error
> text in this
> > case:
> > FATAL: database "foo" does not exist
>
> > New ODBC driver with Postgres 8.1 returns the same error in
> all cases:
> > Could not connect to the server
>
> This seems like a serious regression in behavior. Why isn't
> the driver
> returning the error string provided by libpq?
Some left-over debugging code from the port to libpq by the looks of it.
Fix committed, though interestingly in my testing I *almost* always got
the following message from libpq rather than the expected username or db
doesn't exist message:
could not receive data from server: The system cannot find the path
specified.
(0x00000003/3)
Also, am I right in thinking there is no way to get an sqlstate code
from a libpq connection, or did I miss something in the docs? I realise
of course that you can get one from a result object.
Regards, Dave
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Dedect unknown database in 08.01.0100 and Postgres 8.1
@ 2005-11-09 14:22 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2005-11-09 14:22 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Andrus <eetasoft@online.ee>; pgsql-odbc
"Dave Page" <dpage@vale-housing.co.uk> writes:
> Also, am I right in thinking there is no way to get an sqlstate code
> from a libpq connection, or did I miss something in the docs?
Yeah, mainly because there is not any support within libpq for
generating SQLSTATE codes for errors reported by the library itself.
Somebody should step up and fix that sometime.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2005-11-09 14:22 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-08 18:26 Dedect unknown database in 08.01.0100 and Postgres 8.1 Andrus <eetasoft@online.ee>
2005-11-08 19:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-11-08 20:00 ` me@alternize.com
2005-11-09 09:43 Re: Dedect unknown database in 08.01.0100 and Postgres 8.1 Dave Page <dpage@vale-housing.co.uk>
2005-11-09 14:22 ` Tom Lane <tgl@sss.pgh.pa.us>
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