Libpq: Passing a Pgconn* object between console applications ?

From: David(dot)Jacques(at)CCRS(dot)NRCan(dot)gc(dot)ca
To: pgsql-admin(at)postgresql(dot)org
Subject: Libpq: Passing a Pgconn* object between console applications ?
Date: 2005-02-18 16:13:39
Message-ID: B7F9814D6850C949947CF8DEA13477810207ABC1@s5-ccr-r2.ccrs.nrcan.gc.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I have a function defined in my own library (.lib) that updates a table of
logged information about
the start and end times, return codes, etc. of etl, backup, and other such
processes.

The function uses an existing connection to the DB and writes a new record
to that log table.

void UpdateLog(char* sTName,char* sTimeStamp,int iProcID,char* sMessage,int
iLogType,int iErrorCode,PGconn* pConn);

The scenario is this:

sched.exe -- starts
-- connects to db (Pgconn* pCon1)
-- queries scheduling table for times to call other processes.
-- if it is time...
-calls other process i.e. process1.exe
process1.exe
-starts, makes connection to db Pgconn* pCon2
-calls function to update log that process1.exe
(with Pgconn* pCon2 as arg) has started at time t1
-does its work
-calls function to update log that process1.exe
(with Pgconn* pCon2 as arg) has ended at time t2.
-ends.
-- endif
-- sched.exe ends

I'm wondering whether I can pass an existing, opened db connection (Pgconn*)
as an argument to UpdateLog().

Has anyone done this ?

Thanks

Dave

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-02-18 16:19:14 Re: OID assistance
Previous Message Greg Spiegelberg 2005-02-18 15:54:15 Re: OID assistance