pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Harry Broomhall <harry.broomhall@uk.easynet.net>
To: pgsql-odbc@postgresql.org
Subject: Problems with PGSQL ODBC drivers
Date: Wed, 8 Jan 2003 17:33:47 +0000 (GMT)
Message-ID: <200301081733.RAA72769@haeb.noc.uk.easynet.net> (raw)

    I posted this to the general newsgroup
'comp.databases.postgresql.questions' a little while ago, and got no takers!

<grin>

    As I am fairly sure this is a ODBC driver issue I am reposting it here,
somewhat ammended, in the hope of enlightenment.

===================================

   I have run up against a problem trying to use the PostgreSQL ODBC
Windows driver, and wondered if anyone can point me in the right
direction.

   Basics:

Server:  PostgreSQL 7.2.1 on i386-unknown-freebsd4.5,
         compiled by GCC 2.95.3

ODBC driver:  PostgreSQL (not beta) 7.02.00.05

Windows:  NT4  - SP 4

Excel 2000

  I have a view on the server from which I wish to import data into
Excel, using MS Query.

  If I type the SQL query direct into MSQuery it works fine, and the
data is fetched.

  If I attempt to use the MSQuery 'wizard' then when I get to 'Finish'
and ask to return the data to Excel then I get an Error box with the
message:  "Error:  No such attribute or function 'oid'".  This message
is echoed in the PostgreSQL logs.

  I enabled the log files in the ODBC driver, and noticed that an
attribute 'oid' was added to the query that I would otherwise have
expected the MSQuery app to send.  AFAIK views don't have oids, so it
would seem to me that the driver is misidentifying the view as a table
with oids?

   Looking further at the logs, and going though the driver source, it
*looks* to me as if the code for the ODBC function SQLSpecialColumns
when called with IdentifierType = SQL_BEST_ROWID may be the culprit.

   It *always* (AFAICT) returns oid for this call.

   Looking through info.c I note the following:

  There is a comment early in the function where it says 'Create the
query to find out if this is a view or not...', and fetches
pg_class.relhasrules.  However in the code for SQLTables is the
comment 'view is represented by its relkind since 7.1'.

   Any suggestions as to work-arounds, patches, or tests to try would
be welcomed.

========================

   Regards,
          Harry.
 




view thread (11+ messages)  latest in thread

Message-ID: <200301081733.RAA72769@haeb.noc.uk.easynet.net>
Permalink:  ../200301081733.RAA72769@haeb.noc.uk.easynet.net/
Also on:    postgresql.org/message-id/200301081733.RAA72769@haeb.noc.uk.easynet.net

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: harry.broomhall@uk.easynet.net
  Subject: Re: Problems with PGSQL ODBC drivers
  In-Reply-To: <200301081733.RAA72769@haeb.noc.uk.easynet.net>
  References: <200301081733.RAA72769@haeb.noc.uk.easynet.net>

* 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