Re: What constitutes a pgsql session? - Mailing list pgsql-novice

From Bruce Momjian
Subject Re: What constitutes a pgsql session?
Date
Msg-id 200408111659.i7BGx2i19971@candle.pha.pa.us
Whole thread Raw
In response to Re: What constitutes a pgsql session?  (Andrew Kelly <akelly@transparency.org>)
List pgsql-novice
Andrew Kelly wrote:
> On Wed, 2004-08-11 at 03:44, Bruce Momjian wrote:
> > Taber, Mark wrote:
> > > We have a need to create temporary tables (within functions); the
> > > documentation states that temporary tables last as long as the pg session.
> > > What, precisely, does this mean?  The length of the active connection?
> >
> > Yes, a session is the client/server db connection.  When you disconnect,
> > the session is terminated.
>
> What happens during connection pooling?
> Would a temp table be global to everybody on the same connection?
> Would the table remain after "my" disconnect, when others are still
> connected via the shared session "I" was just using?

With connection pooling, the table would still exist.  Connection
pooling code needs to do a RESET ALL to reset any changed variables, and
it also need to look in pg_temp_(my_backend) schema and delete
everything there too before passing the connetion to someone else.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-novice by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Another 'db session' question...
Next
From: "Scott Marlowe"
Date:
Subject: Re: Another 'db session' question...