Primary Key with serial

From: "x asasaxax" <xanaruto(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Primary Key with serial
Date: 2008-03-29 00:30:43
Message-ID: 91495cb0803281730w395e00e9md8f9e4c41f1a2cd9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

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? If not, what can i do to make this happen?

Thanks a lot

Responses

Browse pgsql-general by date

  From Date Subject
Next Message brian 2008-03-29 00:41:46 Re: Primary Key with serial
Previous Message Ivan Sergio Borgonovo 2008-03-29 00:15:32 general optimisation rule for slice of table frequently accessed.