Re: Means to emulate global temporary table

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: George Neuner <gneuner2(at)comcast(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Means to emulate global temporary table
Date: 2017-01-12 15:05:20
Message-ID: cf4240cf-373c-3dd5-6d97-5274d26f2b89@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/12/2017 12:37 AM, George Neuner wrote:
> On Wed, 11 Jan 2017 15:23:10 -0800, John R Pierce
> <pierce(at)hogranch(dot)com> wrote:
>
>> On 1/11/2017 2:07 PM, Ian Lewis wrote:
>>> I am working on porting from an SQL Anywhere server that has support
>>> for general temporary tables. It appears that PostgreSQL does not have
>>> such support.
>>
>> postgres temporary tables are either local to a transaction, or to a
>> connection/session, and are automatically deleted when the transaction
>> or session terminates.
>>
>> how do these 'general temporary tables' differ from regular tables that
>> you create on demand, then delete when you're done with them?
>
> SQL Anywhere has a couple of interesting twists on temporary tables.
>
> First, it allows temporary tables to be defined as part of the
> database schema, and to have them implicitly instantiated upon the
> first mention in a session. It is not necessary to issue a "create"
> call before using the table.
>
> Second, it allows temporary tables to be _per_user_ ("global") in
> addition to per connection ("local"). Global temp tables are shared
> by simultaneous connections from the same user - once created they
> persist until the last connection by the owning user is closed.

Aah, now I see, thanks for this.

>
> George
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Vanasco 2017-01-12 17:09:49 Re: temporarily disable autovacuum on a database or server ?
Previous Message Andreas Joseph Krogh 2017-01-12 12:13:34 RUM-index and support for storing BIGINT as part of a tsvector+timestamp