Re: Uniquely identify a connection? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Uniquely identify a connection?
Date
Msg-id Pine.LNX.4.30.0109081225520.702-100000@peter.localdomain
Whole thread Raw
In response to Uniquely identify a connection?  (<swalker@iglou.com>)
List pgsql-general
swalker@iglou.com writes:

> Is there a way in postgres to uniquely identify a connection?  ie - get
> something like the process id ?

No, but you can easily write your own:  (Made up from memory, syntax
details may vary.)

PG_FUNCTION_INFO_V1(sql_getpid);

Datum
sql_getpid(PG_FUNCTION_ARGS)
{
    PG_RETURN_INT32((int32)getpid());
}

Declare as

CREATE FUNCTION pid() RETURNS integer AS 'filename here', 'sql_getpid'
LANGUAGE 'C';

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: Tod McQuillin
Date:
Subject: Re: Problem w/ dumping huge table and no disk space
Next
From: Vince Vielhaber
Date:
Subject: Re: Idea: jobs.postgresql.org