Re: What constitutes a pgsql session?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Kelly <akelly(at)transparency(dot)org>
Cc: "Taber, Mark" <Mark(dot)Taber(at)dof(dot)ca(dot)gov>, pgsql-novice(at)postgresql(dot)org
Subject: Re: What constitutes a pgsql session?
Date: 2004-08-11 16:59:02
Message-ID: 200408111659.i7BGx2i19971@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Momjian 2004-08-11 17:24:26 Re: dbf2pg missing
Previous Message Scott Marlowe 2004-08-11 16:56:04 Re: Another 'db session' question...