pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Stanaway <david@netventures.com.au>
To: Dado Feigenblatt <dado@wildbrain.com>
To: Pgsql-Sql <pgsql-sql@postgresql.org>
Subject: Re: nextval on insert by arbitrary sequence
Date: Sat, 21 Jul 2001 14:30:17 +1000
Message-ID: <200107210431.OAA23816@lorica.ucc.usyd.edu.au> (raw)
In-Reply-To: <3B58C71F.9070703@wildbrain.com>

Have you looked at the serial type?

This type creates an explicity sequence with a predictable name:
tblname_rowname_seq

and has a default value that selects the next val from that sequence.
You can get the value of the most recently inserted row in your session 
with
CurrVal('tblname_rowname_seq')

Hope this helps :)

On Saturday, July 21, 2001, at 10:04  AM, Dado Feigenblatt wrote:

> Josh Berkus wrote:
>
>> Dado,
>>
>> Maybe we're looking at this the hard way.  Have you thought of simply
>> putting in a DATETIME column and sorting by that?
>>
>> -Josh
>>
> Sorting? I might have expressed myself wrong.
> I'm not concerned about sorting.
> I'm concerned about giving rows in a single table an unique, sequential 
> numbered ID
> based on a sequence per project (as in a serial counter, as in 'create 
> sequence specific_project_sequence;')
> e.g.
> rows related to project A get a number from sequence A
> rows related to project B get a number from sequence B
>
> Is it clear now, or is it me who's not understanding what you're saying?
>
> Sorry for the confusion.
>
>
>
>
>
> -- Dado Feigenblatt                                 Wild Brain, Inc.   
> Technical Director                               (415) 553-8000 x???
> dado@wildbrain.com                               San Francisco, CA.
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
Best Regards
David Stanaway
================================
Technology Manager
Australia's Premier Internet Broadcasters
Phone: +612 9357 1699
Fax: +612 9357 1169
Web: http://www.netventures.com.au
Support: support@netventures.com.au
================================
The Inspire Foundation is proudly supported by Net Ventures through the 
provision of streaming solutions for it's national centres.  The Inspire 
Foundation is an Internet-based foundation that inspires young people to 
help themselves, get involved and get online. Please visit Inspire at 
http://www.inspire.org.au




view thread (9+ messages)  latest in thread

Message-ID: <200107210431.OAA23816@lorica.ucc.usyd.edu.au>
Permalink:  ../200107210431.OAA23816@lorica.ucc.usyd.edu.au/
Also on:    postgresql.org/message-id/200107210431.OAA23816@lorica.ucc.usyd.edu.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david@netventures.com.au, dado@wildbrain.com
  Subject: Re: nextval on insert by arbitrary sequence
  In-Reply-To: <200107210431.OAA23816@lorica.ucc.usyd.edu.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox