Re: change to error result in SQLStatistics

From: "Scot Loach" <sloach(at)sandvine(dot)com>
To: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: change to error result in SQLStatistics
Date: 2004-10-05 14:16:07
Message-ID: A8535F8D62F3644997E91F4F66E341FCA1379F@exchange.sandvine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

I agree with your suggestion to check that the table exists at the beginning of PGAPI_Statistics().

What would you suggest as a query to do this?

for example - I can do the following query -
"select relname from pg_class where relname = 'elem_portstats';"

and do an Fetch, and return an error if there are no results.

scot.

-----Original Message-----
From: pgsql-odbc-owner(at)postgresql(dot)org
[mailto:pgsql-odbc-owner(at)postgresql(dot)org]On Behalf Of Dave Page
Sent: Tuesday, October 05, 2004 4:40 AM
To: Scot Loach; pgsql-odbc(at)postgresql(dot)org
Subject: Re: [ODBC] change to error result in SQLStatistics

> -----Original Message-----
> From: pgsql-odbc-owner(at)postgresql(dot)org
> [mailto:pgsql-odbc-owner(at)postgresql(dot)org] On Behalf Of Scot Loach
> Sent: 05 October 2004 04:19
> To: pgsql-odbc(at)postgresql(dot)org
> Subject: [ODBC] change to error result in SQLStatistics
>
> info.c version 1.106 changes the semantics of
> PGAPI_Statistics. If a table name is passed in and the table
> does not exist, the function previously returned SQL_ERROR,
> it now returns SQL_SUCCESS.

Hi Scot,

My best guess is that it is an attempt to prevent errors occuring on
zero column tables, such as one that inherits other tables. It cannot
currently tell whether a table exists or not however, because it uses
SQLColumns which can return SQL_SUCCESS when used with a search pattern
that doesn't match any tables (I'm not entirely convinced that is
correct, but as noone has ever complained, I don't think it should be
changed). I guess the simple answer is to add a check for the table at
the beginning of the function and return an error there if required.

Any other thoughts?

Regards, Dave

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Browse pgsql-odbc by date

  From Date Subject
Next Message anthony.caduto 2004-10-05 14:18:32 Re: Access and PG ODBC problem
Previous Message Dave Page 2004-10-05 14:12:59 Re: Access and PG ODBC problem