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

Re: Primary Key with serial

From: Berend Tober <btober(at)ct(dot)metrocast(dot)net>
To: x asasaxax <xanaruto(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary Key with serial
Date: 2008-03-29 16:54:06
Message-ID: 47EE742E.3040901@ct.metrocast.net (view raw or flat)
Thread:
Lists: pgsql-general
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

Responses

pgsql-general by date

Next:From: Scott MarloweDate: 2008-03-29 16:55:09
Subject: Re: Using tables in other PostGreSQL database
Previous:From: Shane AmblerDate: 2008-03-29 16:36:05
Subject: Re: GSoC Proposal: PL/Mono

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