Re: database design questions - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: database design questions
Date
Msg-id 20060403151528.80406.qmail@web31812.mail.mud.yahoo.com
Whole thread Raw
In response to Re: database design questions  ("Tomi NA" <hefest@gmail.com>)
List pgsql-general

--- Tomi NA <hefest@gmail.com> wrote:

> On 4/3/06, Ottavio Campana <ottavio@campana.vi.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


pgsql-general by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: pl/pgsql uniq varchar[] sort?
Next
From: Keary Suska
Date:
Subject: Re: database design questions