Libpq: Passing a Pgconn* object between console applications ?

Поиск
Список
Период
Сортировка
От David.Jacques@CCRS.NRCan.gc.ca
Тема Libpq: Passing a Pgconn* object between console applications ?
Дата
Msg-id B7F9814D6850C949947CF8DEA13477810207ABC1@s5-ccr-r2.ccrs.nrcan.gc.ca
обсуждение исходный текст
Список 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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Greg Spiegelberg
Дата:
Сообщение: Re: OID assistance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: OID assistance