Обсуждение: libpq or ESQL
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