pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
INT8 sequences
2+ messages / 2 participants
[nested] [flat]

* INT8 sequences
@ 2001-05-07 16:10  Radius Administrator <radius@mail.cnz.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Radius Administrator @ 2001-05-07 16:10 UTC (permalink / raw)
  To: pgsql-sql

Is it true that PostgreSQL sequences are always INT4?  If so, how
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
);

Thanks.

Lyle Frost
Citadel Network
www.cnz.com
radius@cnz.com



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: INT8 sequences
@ 2001-05-08 19:43  Richard Huxton <dev@archonet.com>
  parent: Radius Administrator <radius@mail.cnz.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Huxton @ 2001-05-08 19:43 UTC (permalink / raw)
  To: Radius Administrator <radius@mail.cnz.com>; +Cc: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-05-08 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-07 16:10 INT8 sequences Radius Administrator <radius@mail.cnz.com>
2001-05-08 19:43 ` Richard Huxton <dev@archonet.com>

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