From: Byron Nikolaidis <byronn@solipsys.com>
To: Dave Page <dpage@vale-housing.co.uk>
Cc: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] ODBC: OID column in views
Date: Tue, 29 Jun 1999 12:41:23 -0400
Message-ID: <3778F732.6C2A0D5D@solipsys.com> (raw)
References: <B9FE686F5C26D311AC22006097BCD3D65EFE@woody.vale-housing.co.uk>
Dave Page wrote:
> >
> > I'm not sure what you mean by "the driver will always attempt
> > to retrieve the oid
> > column"... What is the driver doing? If it is sending
> > another query, could you show
> > me exactly what because its been a while since I looked at the code.
>
> The commlog shows the following when the query 'SELECT * FROM pg_tables;' is
> executed via DAO (I've just thought though, would it be the driver or
> perhaps DAO that is expanding the wildcard?):
>
> conn=175915324, query='SELECT "oid" ,"tablename" ,"tableowner" ,"hasindexes"
> ,"hasrules" ,"hastriggers" FROM "pg_tables" '
> ERROR from backend during send_query: 'ERROR: system column oid not
> available - pg_tables is a view'
> STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while
> executing the query'
>
> Presumably if it's DAO that's expanding the wildcard, it would still be the
> driver reporting the existance of the oid column?
>
Ahhhh, I see now. DAO is calling SQLColumns() on the "pg_tables" table. Since
the driver realizes it is a system table (i.e., because it begins with pg_), it
automatically throws the OID column in there. There is no option to turn that
off and it is not intelligent enough to check whether it is a view.
The idea was that when looking at System Tables, you would always be interested
in the oid column so the driver should show it.
Wait a minute, I don't remember any "pg_tables" view??? Is that really a system
table, or something you created? If its something you created, you can just not
start it with "pg_" and problem solved!
Another possibility is to use SQLTables() meta function to get the tables
instead of using a low level query. Theoretically, it would be more portable.
Byron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: byronn@solipsys.com, dpage@vale-housing.co.uk
Subject: Re: [INTERFACES] ODBC: OID column in views
In-Reply-To: <3778F732.6C2A0D5D@solipsys.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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