Re: database design questions

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: database design questions
Date: 2006-04-03 15:15:28
Message-ID: 20060403151528.80406.qmail@web31812.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Tomi NA <hefest(at)gmail(dot)com> wrote:

> On 4/3/06, Ottavio Campana <ottavio(at)campana(dot)vi(dot)it> wrote:
>
>
> > 3) faq 4.11.1 says
> >
> > > CREATE TABLE person (
> > > id SERIAL,
> > > name TEXT
> > > );
> > >
> > >is automatically translated into this:
> > >
> > > CREATE SEQUENCE person_id_seq;
> > > CREATE TABLE person (
> > > id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
> > > name TEXT
> > > );
> >
> > how can I do it with a INT8 instead of a INT4?
> >
> > Thank you
> >
>
> Is there a reason not to write explicitly?
>
> CREATE SEQUENCE person_id_seq;
> CREATE TABLE person (
> id INT8 NOT NULL DEFAULT nextval('person_id_seq'),
> name TEXT
> );

you could also do:

CREATE TABLE person (
id BIGSERIAL,
name TEXT
);

Regards,

Richard

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Refondini 2006-04-03 15:44:18 RAISE function misuse ?
Previous Message Merlin Moncure 2006-04-03 15:10:22 Re: pl/pgsql uniq varchar[] sort?