Thread: Re: [HACKERS] Non-standard feature request

Re: [HACKERS] Non-standard feature request

From
Gavin Sherry
Date:
On Fri, 14 Jun 2002, Gavin Sherry wrote:

> On Thu, 13 Jun 2002, Mike Mascari wrote:
>
> >
> > CREATE TEMPORARY TABLE
> > ...
> > ON COMMIT DROP;
> >
> > pseudo-compatible with the SQL-standard of:
> >
> > ON COMMIT { DELETE | PRESERVE } ROWS;
> >
> > so one day PostgreSQL's grammar would look like:
> >
> > ...
> > ON COMMIT { DROP | { DELETE | PRESERVE } ROWS };
>
> I think this is a pretty useful feature. Shouldn't require too much
> work. A new relkind or a bool in TempTable and a little code in
> AtEOXact_temp_relations() to heap_drop_with_catalog() the registered temp
> table.
>
> Anyone else keen for this feature?

Attached is a patch implementing this. The patch is against 7.2.1
source. The grammar introduced is of the form:

    CREATE TEMP TABLE ... ON COMMIT DROP;

Is this a desirable feature? Seems pretty useful to me.

Gavin


Re: [HACKERS] Non-standard feature request

From
Gavin Sherry
Date:
Slight bug in the previous patch. Logically (and according to SQL99's
treatment of ON COMMIT), it can be specified only for CREATE TEMP
TABLE. The patch throws an error if only CREATE TABLE has been specified.

Gavin

On Fri, 28 Jun 2002, Gavin Sherry wrote:

> On Fri, 14 Jun 2002, Gavin Sherry wrote:
>
> > On Thu, 13 Jun 2002, Mike Mascari wrote:
> >
> > >
> > > CREATE TEMPORARY TABLE
> > > ...
> > > ON COMMIT DROP;
> > >
> > > pseudo-compatible with the SQL-standard of:
> > >
> > > ON COMMIT { DELETE | PRESERVE } ROWS;
> > >
> > > so one day PostgreSQL's grammar would look like:
> > >
> > > ...
> > > ON COMMIT { DROP | { DELETE | PRESERVE } ROWS };
> >
> > I think this is a pretty useful feature. Shouldn't require too much
> > work. A new relkind or a bool in TempTable and a little code in
> > AtEOXact_temp_relations() to heap_drop_with_catalog() the registered temp
> > table.
> >
> > Anyone else keen for this feature?
>
> Attached is a patch implementing this. The patch is against 7.2.1
> source. The grammar introduced is of the form:
>
>     CREATE TEMP TABLE ... ON COMMIT DROP;
>
> Is this a desirable feature? Seems pretty useful to me.
>
> Gavin
>
>

Attachment

Re: [HACKERS] Non-standard feature request

From
"Christopher Kings-Lynne"
Date:
> > Anyone else keen for this feature?
>
> Attached is a patch implementing this. The patch is against 7.2.1
> source. The grammar introduced is of the form:
>
> CREATE TEMP TABLE ... ON COMMIT DROP;
>
> Is this a desirable feature? Seems pretty useful to me.

It's useful, there's a patch - what more do we want!!!

Chris





Re: [HACKERS] Non-standard feature request

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Gavin Sherry wrote:
> Slight bug in the previous patch. Logically (and according to SQL99's
> treatment of ON COMMIT), it can be specified only for CREATE TEMP
> TABLE. The patch throws an error if only CREATE TABLE has been specified.
>
> Gavin
>
> On Fri, 28 Jun 2002, Gavin Sherry wrote:
>
> > On Fri, 14 Jun 2002, Gavin Sherry wrote:
> >
> > > On Thu, 13 Jun 2002, Mike Mascari wrote:
> > >
> > > >
> > > > CREATE TEMPORARY TABLE
> > > > ...
> > > > ON COMMIT DROP;
> > > >
> > > > pseudo-compatible with the SQL-standard of:
> > > >
> > > > ON COMMIT { DELETE | PRESERVE } ROWS;
> > > >
> > > > so one day PostgreSQL's grammar would look like:
> > > >
> > > > ...
> > > > ON COMMIT { DROP | { DELETE | PRESERVE } ROWS };
> > >
> > > I think this is a pretty useful feature. Shouldn't require too much
> > > work. A new relkind or a bool in TempTable and a little code in
> > > AtEOXact_temp_relations() to heap_drop_with_catalog() the registered temp
> > > table.
> > >
> > > Anyone else keen for this feature?
> >
> > Attached is a patch implementing this. The patch is against 7.2.1
> > source. The grammar introduced is of the form:
> >
> >     CREATE TEMP TABLE ... ON COMMIT DROP;
> >
> > Is this a desirable feature? Seems pretty useful to me.
> >
> > Gavin
> >
> >

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



Re: [HACKERS] Non-standard feature request

From
Bruce Momjian
Date:
Gavin, I will need a doc patch for this too.  Thanks.

---------------------------------------------------------------------------

Gavin Sherry wrote:
> Slight bug in the previous patch. Logically (and according to SQL99's
> treatment of ON COMMIT), it can be specified only for CREATE TEMP
> TABLE. The patch throws an error if only CREATE TABLE has been specified.
>
> Gavin
>
> On Fri, 28 Jun 2002, Gavin Sherry wrote:
>
> > On Fri, 14 Jun 2002, Gavin Sherry wrote:
> >
> > > On Thu, 13 Jun 2002, Mike Mascari wrote:
> > >
> > > >
> > > > CREATE TEMPORARY TABLE
> > > > ...
> > > > ON COMMIT DROP;
> > > >
> > > > pseudo-compatible with the SQL-standard of:
> > > >
> > > > ON COMMIT { DELETE | PRESERVE } ROWS;
> > > >
> > > > so one day PostgreSQL's grammar would look like:
> > > >
> > > > ...
> > > > ON COMMIT { DROP | { DELETE | PRESERVE } ROWS };
> > >
> > > I think this is a pretty useful feature. Shouldn't require too much
> > > work. A new relkind or a bool in TempTable and a little code in
> > > AtEOXact_temp_relations() to heap_drop_with_catalog() the registered temp
> > > table.
> > >
> > > Anyone else keen for this feature?
> >
> > Attached is a patch implementing this. The patch is against 7.2.1
> > source. The grammar introduced is of the form:
> >
> >     CREATE TEMP TABLE ... ON COMMIT DROP;
> >
> > Is this a desirable feature? Seems pretty useful to me.
> >
> > Gavin
> >
> >

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



Re: [HACKERS] Non-standard feature request

From
Bruce Momjian
Date:
Gavin, this is not even close to the CVS code.  Would you regenerate
based on CVS.  I could do it, but you will probably make a more reliable
patch.


---------------------------------------------------------------------------

Gavin Sherry wrote:
> Slight bug in the previous patch. Logically (and according to SQL99's
> treatment of ON COMMIT), it can be specified only for CREATE TEMP
> TABLE. The patch throws an error if only CREATE TABLE has been specified.
>
> Gavin
>
> On Fri, 28 Jun 2002, Gavin Sherry wrote:
>
> > On Fri, 14 Jun 2002, Gavin Sherry wrote:
> >
> > > On Thu, 13 Jun 2002, Mike Mascari wrote:
> > >
> > > >
> > > > CREATE TEMPORARY TABLE
> > > > ...
> > > > ON COMMIT DROP;
> > > >
> > > > pseudo-compatible with the SQL-standard of:
> > > >
> > > > ON COMMIT { DELETE | PRESERVE } ROWS;
> > > >
> > > > so one day PostgreSQL's grammar would look like:
> > > >
> > > > ...
> > > > ON COMMIT { DROP | { DELETE | PRESERVE } ROWS };
> > >
> > > I think this is a pretty useful feature. Shouldn't require too much
> > > work. A new relkind or a bool in TempTable and a little code in
> > > AtEOXact_temp_relations() to heap_drop_with_catalog() the registered temp
> > > table.
> > >
> > > Anyone else keen for this feature?
> >
> > Attached is a patch implementing this. The patch is against 7.2.1
> > source. The grammar introduced is of the form:
> >
> >     CREATE TEMP TABLE ... ON COMMIT DROP;
> >
> > Is this a desirable feature? Seems pretty useful to me.
> >
> > Gavin
> >
> >

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



Re: [HACKERS] Non-standard feature request

From
Gavin Sherry
Date:
Hi Bruce,

I have been away on a long overdue holiday. Will get you this patch once I
catch up on email and pending 'day job' stuff.

Gavin

On Thu, 4 Jul 2002, Bruce Momjian wrote:

>
> Gavin, I will need a doc patch for this too.  Thanks.
>
> ---------------------------------------------------------------------------
>
> Gavin Sherry wrote:
> > Slight bug in the previous patch. Logically (and according to SQL99's
> > treatment of ON COMMIT), it can be specified only for CREATE TEMP
> > TABLE. The patch throws an error if only CREATE TABLE has been specified.
> >
> > Gavin
> >
> > On Fri, 28 Jun 2002, Gavin Sherry wrote:
> >
> > > On Fri, 14 Jun 2002, Gavin Sherry wrote:
> > >
> > > > On Thu, 13 Jun 2002, Mike Mascari wrote:
> > > >
> > > > >
> > > > > CREATE TEMPORARY TABLE
> > > > > ...
> > > > > ON COMMIT DROP;
> > > > >
> > > > > pseudo-compatible with the SQL-standard of:
> > > > >
> > > > > ON COMMIT { DELETE | PRESERVE } ROWS;
> > > > >
> > > > > so one day PostgreSQL's grammar would look like:
> > > > >
> > > > > ...
> > > > > ON COMMIT { DROP | { DELETE | PRESERVE } ROWS };
> > > >
> > > > I think this is a pretty useful feature. Shouldn't require too much
> > > > work. A new relkind or a bool in TempTable and a little code in
> > > > AtEOXact_temp_relations() to heap_drop_with_catalog() the registered temp
> > > > table.
> > > >
> > > > Anyone else keen for this feature?
> > >
> > > Attached is a patch implementing this. The patch is against 7.2.1
> > > source. The grammar introduced is of the form:
> > >
> > >     CREATE TEMP TABLE ... ON COMMIT DROP;
> > >
> > > Is this a desirable feature? Seems pretty useful to me.
> > >
> > > Gavin
> > >
> > >
>
> Content-Description:
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
>
>