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: serial column


  • From: Bob Pawley <rjpawley(at)shaw(dot)ca>
  • To: Gevik Babakhani <pgdev(at)xs4all(dot)nl>
  • Cc: Postgresql <pgsql-general(at)postgresql(dot)org>
  • Subject: Re: serial column
  • Date: Sun, 24 Sep 2006 16:31:20 -0700
  • Message-id: <00d701c6e031$8a9c3470$8e904618(at)owner>

Thanks

I'll give that a try.

Bob
----- Original Message ----- From: "Gevik Babakhani" <pgdev(at)xs4all(dot)nl>
To: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
Cc: "Postgresql" <pgsql-general(at)postgresql(dot)org>
Sent: Sunday, September 24, 2006 4:13 PM
Subject: Re: [GENERAL] serial column


On Sun, 2006-09-24 at 15:29 -0700, Bob Pawley wrote:
"A possible solution for this would be to regenerate the entire column's
values every time a record gets deleted starting form 1. but then again
this would be very slow if you have a very large table"

I don't anticipate the table to be more than a few hundred rows - certainly
fewer than 1,000.

Could you point to some documentation for regenerating a column's values
other than manual??

Bob

I am afraid there is no built-in way to do that.
perhaps you could create a function that:
step1: creates a sequence (with random name)....
step2: update table set field=netval('random_seq_name');
step3: drop sequence...

--
Regards,
Gevik Babakhani








Home | Main Index | Thread Index

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