Re: TRUNCATE TABLE with IDENTITY - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: TRUNCATE TABLE with IDENTITY
Date
Msg-id 87r6dyn45i.fsf@oxford.xeocode.com
Whole thread Raw
In response to TRUNCATE TABLE with IDENTITY  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.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!


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: TRUNCATE TABLE with IDENTITY
Next
From: Andrew Dunstan
Date:
Subject: Re: [pgsql-www] New email list for emergency communications