Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-general

   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


pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group