Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Sequence update function?



do a

select setval('sequence',max(col)+1) from tablename

for each table

tm

Uwe C. Schroeder schrieb:
Hi,

just thought I ask before I start doing it myself: Has anyone ever written a stored procedure (or any other means) of syncing the sequence to the max # key in the corresponding tables?

begin:vcard
fn:Thomas Markus
n:Markus;Thomas
org:proventis GmbH
adr:;;Zimmerstr. 79-80;Berlin;Berlin;10117;Germany
email;internet:t(dot)markus(at)proventis(dot)net
tel;work:+49 30 29 36 399 22
x-mozilla-html:FALSE
url:http://www.proventis.net
version:2.1
end:vcard



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group