X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C1A23D1B1BE for ; Thu, 22 Jul 2004 01:54:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16388-08 for ; Thu, 22 Jul 2004 04:54:21 +0000 (GMT) Received: from mail.greatgulfhomes.com (mail.greatgulfhomes.com [216.191.52.66]) by svr1.postgresql.org (Postfix) with ESMTP id 161BED1B2BD for ; Thu, 22 Jul 2004 01:54:15 -0300 (ADT) Received: from terrynew2 (unknown [216.191.52.74]) by mail.greatgulfhomes.com (Postfix) with SMTP id C82643668DC; Thu, 22 Jul 2004 01:02:14 -0400 (EDT) From: To: "'Kenneth Gonsalves'" , Subject: Re: next integer in serial key Date: Thu, 22 Jul 2004 00:55:40 -0400 Message-ID: <016e01c46fa8$2319d1a0$2766f30a@development.greatgulfhomes.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <0407220815420P.01150@thenilgiris.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200407/239 X-Sequence-Number: 18491 The same way the default value is defined, which you can find by doing: \d tablename Which usually gives something like: Table "public.gbs_floorplans" Column | Type | Modifiers ----------------------+---------------+----------------------------------------- --------------------------------- floorplan_id | integer | not null default nextval('public.gbs_floorplans_floorplan_id_seq'::text) division_id | character(3) | not null floorplan_display_id | character(10) | not null Hence SELECT nextval('public.gbs_floorplans_floorplan_id_seq'::text) Terry Fielder Manager Software Development and Deployment Great Gulf Homes / Ashton Woods Homes terry@greatgulfhomes.com Fax: (416) 441-9085 > -----Original Message----- > From: pgsql-sql-owner@postgresql.org > [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Kenneth Gonsalves > Sent: Wednesday, July 21, 2004 10:46 PM > To: pgsql-sql@postgresql.org > Subject: [SQL] next integer in serial key > > > hi, > how does one get the next number in a serial type row? > -- > regards > kg > > http://www.onlineindianhotels.net - hotel bookings > reservations in over 4600 > hotels in India > http://www.ootygolfclub.org > > ---------------------------(end of > broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >