Re: [HACKERS] CREATE TEMP TABLE .... ON COMMIT

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] CREATE TEMP TABLE .... ON COMMIT
Date: 2002-08-27 05:21:42
Message-ID: GNELIHDDFBOCMGBFGEFOIEOKCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

What about Gavin's CREATE OR REPLACE stuff?

Chris

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of Gavin Sherry
> Sent: Tuesday, 27 August 2002 1:21 PM
> To: Bruce Momjian
> Cc: Tom Lane; pgsql-hackers(at)postgresql(dot)org; pgsql-patches(at)postgresql(dot)org
> Subject: Re: [HACKERS] [PATCHES] CREATE TEMP TABLE .... ON COMMIT
>
>
> Bruce,
>
> I have a working patch for this I just need to test it further. It occured
> to me that there was a bug with the previous implementation in as much as
> it didn't handle situations where the user dropped the temp table in a
> transaction block. As such, I have added a flag to the structure marking
> it dead. This also needs to be undone at ABORT :-). (I knew there was a
> reason for storing the ON COMMIT flag in the system catalogs).
>
> Once I have tested further I will send off. If I come across a problem or
> cannot get to this by Wednesday (tomorrow) I will send them off to Neil
> Conway so that they can make it in. (Unfortunately, I am v. busy atm).
>
> Gavin
>
> On Tue, 27 Aug 2002, Bruce Momjian wrote:
>
> >
> > Gavin, how are you doing with this. As I remember, the only remaining
> > issue was where to store the 'drop on commit' information in the
> > backend. If that is all there is, we can come up with a solution.
> >
> >
> ------------------------------------------------------------------
> ---------
> >
> > Gavin Sherry wrote:
> > > On Fri, 9 Aug 2002, Tom Lane wrote:
> > >
> > > > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > > > template1=# create temp table a (a int) on commit drop;
> > > > > ERROR: You must be inside a transaction to use ON COMMIT
> > > >
> > > > Surely that's only for ON COMMIT DROP, if you intend to offer the
> > > > others?
> > >
> > > I should have provided details of this in the email. SQL99 details the
> > > baviour as follows:
> > >
> > > If TEMPORARY is specified and ON COMMIT is omitted, then ON COMMIT
> > > DELETE ROWS is implicit
> > >
> > > This might give users a bit of a surprise so the effective
> behaviour is ON
> > > COMMIT PRESERVE ROWS.
> > >
> > > As for your question (and, perhaps, SQL99) I don't seen how
> it makes any
> > > sense to specify ON COMMIT outside of a transaction block.
> > >
> > > >
> > > > regards, tom lane
> > > >
> > >
> > > Gavin
> > >
> > >
> > > ---------------------------(end of
> broadcast)---------------------------
> > > TIP 5: Have you checked our extensive FAQ?
> > >
> > > http://www.postgresql.org/users-lounge/docs/faq.html
> > >
> >
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Sacauskis 2002-08-27 05:59:36 BYTEA with ecpg
Previous Message Gavin Sherry 2002-08-27 05:20:30 Re: [HACKERS] CREATE TEMP TABLE .... ON COMMIT

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-08-27 06:42:03 minor auth code cleanup
Previous Message Gavin Sherry 2002-08-27 05:20:30 Re: [HACKERS] CREATE TEMP TABLE .... ON COMMIT