From: terry@greatgulfhomes.com
To: 'Kenneth Gonsalves' <lawgon@thenilgiris.com>
To: pgsql-sql@postgresql.org
Subject: Re: next integer in serial key
Date: Thu, 22 Jul 2004 00:55:40 -0400
Message-ID: <016e01c46fa8$2319d1a0$2766f30a@development.greatgulfhomes.com> (raw)
In-Reply-To: <0407220815420P.01150@thenilgiris.com>
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
>
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: terry@greatgulfhomes.com, lawgon@thenilgiris.com
Subject: Re: next integer in serial key
In-Reply-To: <016e01c46fa8$2319d1a0$2766f30a@development.greatgulfhomes.com>
* 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