Re: TRUNCATE TABLE with IDENTITY

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TRUNCATE TABLE with IDENTITY
Date: 2008-03-25 16:45:45
Message-ID: 87r6dyn45i.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:

> SQL200n specifies a new qualifier on a TRUNCATE command
>
> TRUNCATE TABLE foo
> [ CONTINUE IDENTITY | RESTART IDENTITY ]
>
> CONTINUE IDENTITY is the default and does nothing, like now.
>
> RESTART IDENTITY will reset the SERIAL sequences back to the original
> start value.
>
> Seems like a % project for the TODO list

I think we need SQL standard IDENTITY columns before we can consider adding
SQL standard CONTINUE IDENTITY or RESTART IDENTITY clauses.

The reason the last attempt to add them petered out was precisely because they
*don't* exactly line up with the semantics of sequences so I don't imagine
attempting to shoehorn sequences into these clauses is likely to pan out.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-03-25 16:47:59 Re: [pgsql-www] New email list for emergency communications
Previous Message Bruce Momjian 2008-03-25 16:43:36 Re: TRUNCATE TABLE with IDENTITY

Browse pgsql-patches by date

  From Date Subject
Next Message Brendan Jurd 2008-03-25 17:33:13 Re: Text <-> C string
Previous Message Bruce Momjian 2008-03-25 16:43:36 Re: TRUNCATE TABLE with IDENTITY