Received: from lorica.ucc.usyd.edu.au (lorica.ucc.usyd.edu.au [129.78.64.15]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6L4VHa58017 for ; Sat, 21 Jul 2001 00:31:18 -0400 (EDT) (envelope-from david@netventures.com.au) Received: from localhost (p60758.net10.usyd.edu.au [10.0.237.86]) by lorica.ucc.usyd.edu.au (8.9.3/8.9.3) with ESMTP id OAA23816; Sat, 21 Jul 2001 14:31:10 +1000 (EST) Message-Id: <200107210431.OAA23816@lorica.ucc.usyd.edu.au> Date: Sat, 21 Jul 2001 14:30:17 +1000 Content-Type: text/plain; format=flowed; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v388) From: David Stanaway To: Dado Feigenblatt , Pgsql-Sql X-Mailer: Apple Mail (2.388) In-Reply-To: <3B58C71F.9070703@wildbrain.com> Subject: Re: nextval on insert by arbitrary sequence Content-Transfer-Encoding: 7bit X-Archive-Number: 200107/294 X-Sequence-Number: 4097 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