Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f49AqnA58159 for ; Wed, 9 May 2001 06:52:49 -0400 (EDT) (envelope-from dev@archonet.com) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 2.12 #1) id 14xRaH-000ElY-0Y; Wed, 9 May 2001 11:52:45 +0100 Received: from archonet.com (ibook.archonet.com [192.168.1.32]) by mainbox.archonet.com (Postfix) with ESMTP id 6410E120AA; Tue, 8 May 2001 20:43:56 +0100 (BST) Message-ID: <3AF84C5F.DF5FEE29@archonet.com> Date: Tue, 08 May 2001 20:43:27 +0100 From: Richard Huxton X-Mailer: Mozilla 4.7C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; I; PPC) X-Accept-Language: en MIME-Version: 1.0 To: Radius Administrator Cc: pgsql-sql@postgresql.org Subject: Re: INT8 sequences References: <200105071610.f47GAoT11581@mail.cnz.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/60 X-Sequence-Number: 2861 Radius Administrator wrote: > > Is it true that PostgreSQL sequences are always INT4? If so, how Yep > would the following be modified to work as obviously intended? > > CREATE SEQUENCE tbl_id INCREMENT 1 START 1; > CREATE TABLE tbl > ( > id INT8 DEFAULT NEXTVAL('tbl_id') PRIMARY KEY > ); Check the mailing list archives for lengthy discussions on int8 sequences. Once you've found it's mostly people complaining without volunteering to do anything go over to http://techdocs.postgresql.org/ and look at Roberto Mello's plpgsql cookbook and the int8 page in my postgresql notes - I summarised anything useful I saw about it. The first example I give is probably fine for just generating unique id's. - Richard Huxton