diff options
author | Marc G. Fournier <scrappy@hub.org> | 2002-08-22 00:15:14 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 2002-08-22 00:15:14 +0000 |
commit | da4683fbe1cba48cf5b5b29055b66e0bacb00162 (patch) | |
tree | 87834b1b18614313e895dcc8c504f58af9f6b4b2 /src/interfaces/libpq++/examples/testlibpq4.cc | |
parent | b663f3443ba096a06970214c3e83e79f6e570b84 (diff) | |
download | postgresql-da4683fbe1cba48cf5b5b29055b66e0bacb00162.tar.gz postgresql-da4683fbe1cba48cf5b5b29055b66e0bacb00162.zip |
Okay, libpq++ is moved to GBorg, and all traces of it have been removed
from the core repository ... I haven't *moved* the libpq++ files out of the
tree, mainly as we want to keep them in place for past branches ...
Peter, I think I've covered all the files I need, and re-ran autoconf to make
sure the configure file is in place properly ...
Diffstat (limited to 'src/interfaces/libpq++/examples/testlibpq4.cc')
-rw-r--r-- | src/interfaces/libpq++/examples/testlibpq4.cc | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/interfaces/libpq++/examples/testlibpq4.cc b/src/interfaces/libpq++/examples/testlibpq4.cc deleted file mode 100644 index 6be620e0736..00000000000 --- a/src/interfaces/libpq++/examples/testlibpq4.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* -* testlibpq4.cc -* Test of the asynchronous notification interface -* - populate a test database with the following (use testlibpq4.sql): - -CREATE TABLE TBL1 (i int4); - -CREATE TABLE TBL2 (i int4); - -CREATE RULE r1 AS ON INSERT TO TBL1 DO [INSERT INTO TBL2 values (new.i); NOTIFY TBL2]; - -* Then start up this program -* After the program has begun, do - -INSERT INTO TBL1 values (10); - -* -* -*/ -#include <iostream.h> -#include "libpq++.h" -#include <stdlib.h> - -int main() -{ - // Begin, by connecting to the backend using hardwired constants - // and a test database created by the user prior to the invokation - // of this test program. - const char* dbName = "dbname=template1"; - PgDatabase data(dbName); - - // Check to see that the backend connection was successfully made - if ( data.ConnectionBad() ) - { - cerr << "Connection to database '" << dbName << "' failed." << endl - << data.ErrorMessage() << endl; - exit(1); - } - - // Listen to a table - if ( !data.ExecCommandOk("LISTEN TBL2") ) - { - cerr << "LISTEN command failed" << endl; - exit(1); - } - - // Test asynchronous notification - while (1) - { - // check for asynchronous returns - PGnotify* notify = data.Notifies(); - if (notify) - { - cerr << "ASYNC NOTIFY of '" << notify->relname - << "' from backend pid '" << notify->be_pid - << "' received" << endl; - free(notify); - break; - } - } - return 0; -} |