Re: display temp table structure? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: display temp table structure?
Date
Msg-id 200103131516.KAA11387@candle.pha.pa.us
Whole thread Raw
In response to Re: display temp table structure?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
> Tom Lane wrote:
> >
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > There is no user-visible mapping, though the number is the process id.
> > > You could use that.  I think you can get the backend process id somehow,
> > > but I am not sure how.  Anyone?
> >
> > If you're using libpq, there is a function to retrieve the backend's PID
> > from the PGconn (PQbackendPID).  I don't think any of the other client
> > libraries provide this (yet).
>
> I installed getpid() as a user-defined function (while testing an idea)
> - it seemed to work and I assumed it was the backend pid I was getting.

Yes, that is the _nify_ fix I was thinking about.  Use the proper path
for libc and:

  CREATE FUNCTION getpid () returns int4 as '/lib/libc.so.6' LANGUAGE 'C';
  SELECT getpid();



--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Alex Howansky
Date:
Subject: Re: "critical mass" reached?
Next
From: Tom Lane
Date:
Subject: Re: Is this a bug in 7.1?