Re: Uniquely identify a connection?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <swalker(at)iglou(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Uniquely identify a connection?
Date: 2001-09-08 10:28:42
Message-ID: Pine.LNX.4.30.0109081225520.702-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

swalker(at)iglou(dot)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(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rjb26 2001-09-08 11:34:44 Help: Postgres, Java and Extended Characters?
Previous Message Martijn van Oosterhout 2001-09-08 09:08:18 Re: Abort state on duplicated PKey in transactions