Re: serial column

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Bob Pawley <rjpawley(at)shaw(dot)ca>
Subject: Re: serial column
Date: 2006-09-25 02:15:48
Message-ID: 200609241915.48630.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You might want to take a look at-
http://www.varlena.com/GeneralBits/
The procedure as shown does not account for renumbering after a delete, but it
might serve as a starting point.

On Sunday 24 September 2006 07:03 pm, Bob Pawley wrote:
> The numbering system is more complex than just assigning a number. It
> invloves about thirty procedures which I have put together and find that it
> works well.
>
> I would like to keep the numbering as a database system which will be
> possible if I can figure out a way of generating sequential numbers without
> possibility of a gap.
>
> Perhaps a manually built table is the answer??
>
> Bob
>
>
> ----- Original Message -----
> From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> To: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
> Cc: "Ragnar" <gnari(at)hive(dot)is>; "Postgresql" <pgsql-general(at)postgresql(dot)org>
> Sent: Sunday, September 24, 2006 4:30 PM
> Subject: Re: [GENERAL] serial column
>
> > Bob Pawley <rjpawley(at)shaw(dot)ca> writes:
> >> I am using the numbers to identify devices.
> >> If a device is deleted or replaced with another type of device I want
> >> the numbering to still be sequential.
> >
> > It sounds to me like you oughtn't be storing these numbers in the
> > database at all. You just want to attach them at display time --- they
> > are certainly utterly meaningless as keys if they can change at any
> > moment.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Johan 2006-09-25 05:00:04 Re: column names in select don't exists in insert to
Previous Message Adrian Klaver 2006-09-25 02:10:34 Re: Restart after poweroutage