Thread: psqlodbc

psqlodbc

From
"Jose' Soares"
Date:
Hi all,

I have a problem with psqlodbc using M$access.
I created a query on M$access, with the following:

SELECT esito1, esito2
FROM brogliacci
WHERE esito1 IS NOT NULL OR esito2 IS NOT NULL;

When I tred to execute the query I had an
ODBC call failed message and then the connection was down.

Here an extract of psqlodbc.log file:

<DELETED>
            ---------------- Socket Info -------------------------------
            socket=53, reverse=0, errornumber=0, errormsg='(null)'
            buffer_in=55122188, buffer_out=55126288
            buffer_filled_in=42, buffer_filled_out=0, buffer_read_in=42
conn=55115896, query='SELECT "brogliacci"."esito1","brogliacci"."esito2"
FROM "brogliacci" WHERE (NOT(("esito1" IS NULL ) ) OR NOT(("esito2" IS
NULL ) ) ) '
STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while
executing the query'

------------------------------------------------------------
                 hdbc=55115896, stmt=55130388, result=0
<DELETED>

I see that psqlodbc translate the query as:

SELECT "brogliacci"."esito1","brogliacci"."esito2"
  FROM "brogliacci"
  WHERE (NOT(("esito1" IS NULL ) ) OR NOT(("esito2" IS NULL ) ) )

I don't know if this syntax is standard but anyway PostgreSQL understand
this syntax
except when the sentence contains the OR operator.

EXAMPLES:

SELECT esito1, esito2 FROM brogliacci
WHERE esito1 Is Not Null OR esito2 Is Not Null;
esito1|esito2
------+------
(0 rows)

SELECT "brogliacci"."esito1","brogliacci"."esito2" FROM "brogliacci"
WHERE (NOT(("esito1" IS NULL ) ) );
esito1|esito2
------+------
(0 rows)

SELECT "brogliacci"."esito1","brogliacci"."esito2" FROM "brogliacci"
WHERE (NOT(("esito1" IS NULL ) ) AND NOT(("esito2" IS NULL ) ) );
esito1|esito2
------+------
(0 rows)

SELECT "brogliacci"."esito1","brogliacci"."esito2" FROM "brogliacci"
WHERE (NOT(("esito1" IS NULL ) ) OR NOT(("esito2" IS NULL ) ) );
pqReadData() -- backend closed the channel unexpectedly.
        This probably means the backend terminated abnormally before or
while pr
ocessing the request.
We have lost the connection to the backend, so further processing is
impossible.
  Terminating.

Should it be considered a bug ?

Please replay to sferac@bo.nettuno.it because I have problems with
jose@sferacarta.com, Thanks
-Jose'-

Re: [INTERFACES] psqlodbc

From
"Thomas G. Lockhart"
Date:
> SELECT esito1, esito2
> FROM brogliacci
> WHERE esito1 IS NOT NULL OR esito2 IS NOT NULL;
> When I tred to execute the query I had an
> ODBC call failed message and then the connection was down.

I believe that Bruce and Vadim just recently fixed this (you have an
index on the table? It might work if you remove the index). Bruce is
gone for a few days for the U.S. Thanksgiving holiday, but may have more
info when he returns...

                      - Tom

Prolog

From
Dan Brickley
Date:
Some months ago, there was a thread on this list (or it's predecessor)
regarding an interface between the PostgreSQL database system and the
Prolog language. I've lost my copy of the messages, but would like to
ask a more general related query: has any work been done interfacing
PostgreSQL to logic based or deductive-database systems?

thanks for any pointers,

Dan




--
Daniel.Brickley@bristol.ac.uk
Institute for Learning and Research Technology http://www.ilrt.bris.ac.uk/
University of Bristol,  Bristol BS8 1TN, UK.   phone:+44(0)117-9288478