Re: [INTERFACES] Re: Possible bugs in ODBC driver - Mailing list pgsql-interfaces

From Hannu Krosing
Subject Re: [INTERFACES] Re: Possible bugs in ODBC driver
Date
Msg-id 353724E8.C518E4DF@sid.trust.ee
Whole thread Raw
In response to Re: Possible bugs in ODBC driver  (Byron Nikolaidis <byronn@insightdist.com>)
List pgsql-interfaces
Byron Nikolaidis wrote:
>
> Dario Fumagalli wrote:
>
> > But... there are some glitches we had not with the previous drivers
> > (neither 0.21 nor 0.3x):
> >
> > 1) There is a minor glitch that (at least under Borland C++ Builder
> > Professional 3.0 + BDE 4.1) causes the metadata of the last table to appear
> > duplicated (if you like I can send you a screen shot). I.e. if I have a
> > database with the following three tables:
> >
> > - customers
> > - orders
> > - order_details
> >
> > The DatabaseExplorer utility Borland gives you to quickly manage tables
> > using SQL (it is like the psql shell in Unix), tells you the database has
> > the following structure:
> >
> > - customers
> > - orders
> > - order_details
> > - order_details
> >
> > with the last entry (and its fields, indexes and so on...) repeated twice.
> > We can see this problem on all our databases. It seems to be some sort of
> > linked list problem. This problem never appeared using the old drivers.
> >
>
> We have had this problem inhouse, and maybe it is possible that you have it.
> The SQLTables() function in the driver does a query very similar to a '\d' in
> the psql (you might want to try that and see if you get the same problem).  The
> query is:
>
> select relname, usename from pg_class, pg_user where relkind = 'r'
> and relname !~ '^xinv[0-9]+' and int4out(usesysid) = int4out(relowner) order by
> relname;
>
> If the relowner does not match the usesysid for all relations, you will get
> multiple entries.
> Maybe we could change the above query to use "distinct" to prevent this.

Maybe, but probably not. I remember taht the old driver used to exhibit
this behaviour for all queries that were issued from Borland products
(i.e. using BDE). Then somebody patched it and it disappeared.

So my guess is that it has creeped back in to the part where tables are
listed. It probably has nothing to do with the actual query returning
duplicate rows.

I don't remember exactly what caused it, but it was an PostODBC/BDE
interaction problem and not a case of the query returning wrong
arguments. Notice that the repeated one is always the last.

OTOH, I may be entirely wrong, as I have not tried to use it with
Borland stuff for more than a year. (but I will try again shortly).

Hannu

pgsql-interfaces by date:

Previous
From: "Julia A.Case"
Date:
Subject: Re: [INTERFACES] Re: [QUESTIONS] ODBC Driver and Install script (PLEASE READ!)
Next
From: Peter T Mount
Date:
Subject: Solaris 2.6 binary for Postgresql (fwd)