Re: Implementation of global temporary tables? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Implementation of global temporary tables?
Date
Msg-id CAFj8pRBo87DH-Lhxea4zXewPHZ6gLfSeyNfco0xbuQSX0H29rw@mail.gmail.com
Whole thread Raw
In response to Re: Implementation of global temporary tables?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers


2015-07-15 15:53 GMT+02:00 Zhaomo Yang <zhy001@cs.ucsd.edu>:
>  there is other question - what is effect of ALTER TABLE of global temp table on 
>  instances of this table in active sessions?

As I said, we need to first agree on the behaviors of the existing commands. I can think of two options now for ALTER TABLE: 1) only allow ALTER TABLE when there is no other active sessions (this is how Oracle deals with it.) 2) handle it as if session copies inherit from the global copy and ALTER TABLE executes on the global copy.

There are two possible kinds of GLOBAL TEMP tables -  session related and transation related. Transaction related tables has very short life - and @1 needs outage, @2 requires stronger locks and can slow and less effective - because a) some changes can be invisible in other transactions (depends on isolation levels), b) the structure can be changed, but function code not (without dependency on isolation levels) - so it can be non consistent, c) why to change table if this table will be dropped in next milisecond. For this case the behave like PL functions can be very practical ~ third option for ALTER TABLE

Regards

Pavel


Thanks,
Zhaomo

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Making ParameterStatus available for more parameter types?
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] Generalized JSON output functions