Re: Serial Updating

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 Updating
Date: 2006-09-03 22:47:33
Message-ID: 200609031547.33951.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday 03 September 2006 02:24 pm, Bob Pawley wrote:
> I have a column that I wish to use to designate loop numbers.
>
> A loop number is composed of a letter (F for flow, T for temperatures etc.)
> followed by a sequence number starting at one and ending with the last
> loop.
>
> The loop numbers will appear as F-1, T-2 and so on.
>
> I seem to have no problem designating the column with the appropriate
> letters.
>
> However, I haven't a clue how to add the numerical portion - or if it is
> even possible.
>
> If anyone has a thought I would appreciate being pointed to some
> documentation that covers this.
>
> Bob Pawley

I am not quite sure of the question here.
To create F-1 you could do 'F'||'-'||1.

If you are asking about creating the serial sequence you may want to look at
the following for an overview of gap less sequences.
http://www.varlena.com/varlena/GeneralBits/130.php
The part on two level sequences would seem to be most appropriate for this
situation.
--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Church 2006-09-03 22:57:28 Syntax for converting double to a timestamp
Previous Message Bob Pawley 2006-09-03 21:24:41 Serial Updating