Re: Queries run twice

From: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: "erne_dev (at) Bellsouth(dot)net" <erne_dev(at)bellsouth(dot)net>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Queries run twice
Date: 2005-03-11 09:45:39
Message-ID: A3D1526C98B7C1409A687E0943EAC410605F24@obelix.askesis.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

pgsql-odbc-owner(at)postgresql(dot)org schreef:
> Running version 8.0 server under WinXP, client is Builder/ADO
> application connecting through ODBC. Found a reference to exactly the
> same problem on
> this msg
> http://archives.postgresql.org/pgsql-odbc/2005-02/msg00033.php. Is
> this a PostgreSQL bug? Or is it ODBC driver? My application
> also works with
> MySQL and this doesn't happen when connecting to a MySQL
> server so I don't
> think is has to do with the ADO components. Like the poster
> of that message
> my query gets executed twice, one as I specified the second
> time without the
> WHERE clause, so the whole Table is returned causing a lot of network
> traffic and slowing things down...What is the 'parse
> statement' mentioned on
> that message? Is that a PostgreSQL setting?
As Richard pointed out, this is done if the odbcdriver cannot determine the execat types of the returned columns. This should be mainly a problem for queries that call a stored procedure as in most circumstances the drivers is capable of getting the types by other means (see the file parse.c in the source distribution).

You could try to turn on the "Use Declare/Fetch": that does not prohibit the query being run twice, but it will leave the data on the server untill requested.

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J(dot)Kraaijeveld(at)Askesis(dot)nl
web: www.askesis.nl

Browse pgsql-odbc by date

  From Date Subject
Next Message lothar.behrens 2005-03-11 11:25:17 SQL_BIT and bit question
Previous Message Richard Huxton 2005-03-11 09:30:58 Re: Queries run twice