Re: Primary Key with serial

From: "x asasaxax" <xanaruto(at)gmail(dot)com>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary Key with serial
Date: 2008-03-31 16:52:51
Message-ID: 91495cb0803310952p22ad1463rae2a3807ba0fdec6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

can anyone do a example for me.. an explain how it works?

Thanks a lot

2008/3/29, Berend Tober <btober(at)ct(dot)metrocast(dot)net>:
>
> x asasaxax wrote:
> > I have the following table create table product(cod serial,
> user_cod
> > bigint, constraint product_fk Foreign Key(user_cod) references
> user(cod),
> > constraint product_pk Primary Key(cod, user_cod));
> >
> > What i want to happend is that:
> > user_cod cod
> > 1 1
> > 1 2
> > 1 3
> > 2 1
> > 3 1
> > 3 2
> >
> > Can serial do that? ...
>
> No.
>
> > ...what can i do to make this happen?
>
>
> http://archives.postgresql.org/pgsql-general/2006-08/msg00744.php
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-03-31 17:27:25 Re: Very slow catalog query
Previous Message Just Someone 2008-03-31 16:52:06 Re: Very slow catalog query