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: 91495cb0803281730w395e00e9md8f9e4c41f1a2cd9@mail.gmail.com (view raw or flat)
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

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-2014 The PostgreSQL Global Development Group