Обсуждение: What constitutes a pgsql session?

Поиск
Список
Период
Сортировка

What constitutes a pgsql session?

От
"Taber, Mark"
Дата:

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? 

 

Thanks for your help.

 

Mark Taber

State of California

Department of Finance

Infrastructure & Architecture Unit

916.323.3104 x2945

 

Re: What constitutes a pgsql session?

От
Bruce Momjian
Дата:
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.

--
  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

Re: What constitutes a pgsql session?

От
Andrew Kelly
Дата:
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?

Andy


Re: What constitutes a pgsql session?

От
Bruce Momjian
Дата:
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