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

From Zoltan Boszormenyi
Subject Re: TRUNCATE TABLE with IDENTITY
Date
Msg-id 480E01EF.5020503@cybertec.at
Whole thread Raw
In response to Re: TRUNCATE TABLE with IDENTITY  (Zoltan Boszormenyi <zb@cybertec.at>)
Responses Re: TRUNCATE TABLE with IDENTITY  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Hi,

Zoltan Boszormenyi írta:
> Updated patch implements TRUNCATE ... RESTART IDENTITY
> which restarts all owned sequences for the truncated table(s).
> Regression tests updated, documentation added. pg_dump was
> also extended to output original[1] START value for creating SEQUENCEs.
>
> [1] For 8.3 and below I could only guesstimate it as MINVALUE for
> ascending
>      and MAXVALUE for descending sequences.
>
> Best regards,
> Zoltán Böszörményi

I just saw this on the CommitFest:May page:

"alvherre says: I'm not sure if this is the same patch in the previous
entry, or a different feature"

I wanted to clarify, the second patch contains two features.
1. stored start value for sequences, ALTER SEQUENCE ... RESTART;
2. (builds on 1.) TRUNCATE ... RESTART IDENTITY;

Best regards,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Regression test fails when BLCKSZ is 1kB
Next
From: Chris Browne
Date:
Subject: Re: Problem with server/utils/snapmgr.h