libpq or ESQL - Mailing list pgsql-novice

From Atif Jung
Subject libpq or ESQL
Date
Msg-id d1c6b9c51003030745l4a4749aayce4ebb5393a33c69@mail.gmail.com
Whole thread Raw
List pgsql-novice
We are migrating from INFORMIX to POSTGRES;
 
Currently we use the following code (for both INFORMIX and POSTGRES,) to connect to the database:
 
EXEC SQL CONNECT TO :acDatabase AS CONNECTION_MAIN;
 
If we need to cancel an SQL request in INFORMIX we call;
 
sqlbreak();
 
This interrupts the database server and cancels any SQL statement currently running.
 
As I understand it POSTGRES uses the libpq functions of:
 
PQgetCancel, PQfreeCancel and PQcancel.
 
However if we've used the above 'CONNECT TO' method to connect to the database we don't have a PGconn connection object which is used by PQgetCancel.
 
My question is therefore, should we be using libpq C function PQconnectdb to connect to the database which will return us the PGconn connection object to use in PGgetCancel, or is there anotherway to interrupt the database server?
 
I should note that this is a multi-threaded application running on AIX 6.1. The WARNING box in the POSTGRESQL guide says that "On Uunix, forking a process with open libpg connections can lead to unpredictable results..." If this is the case how should the database server be interrupted?
 
Thanks to all in advance.
 

Atif

pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Array or not Array?
Next
From: "Dara Olson"
Date:
Subject: sql query on multiple contains