Skip site navigation (1) Skip section navigation (2)

Re: next integer in serial key

From: <terry(at)greatgulfhomes(dot)com>
To: "'Kenneth Gonsalves'" <lawgon(at)thenilgiris(dot)com>,<pgsql-sql(at)postgresql(dot)org>
Subject: Re: next integer in serial key
Date: 2004-07-22 04:55:40
Message-ID: 016e01c46fa8$2319d1a0$2766f30a@development.greatgulfhomes.com (view raw or flat)
Thread:
Lists: pgsql-sql
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(at)greatgulfhomes(dot)com
Fax: (416) 441-9085


> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Kenneth Gonsalves
> Sent: Wednesday, July 21, 2004 10:46 PM
> To: pgsql-sql(at)postgresql(dot)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
>


In response to

pgsql-sql by date

Next:From: Oliver ElphickDate: 2004-07-22 05:31:18
Subject: Re: next integer in serial key
Previous:From: azah azahDate: 2004-07-22 03:13:03
Subject: Re: date_format in postresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group