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

Re: problem with uniques and foreing keys

From: "kernel(dot)alert kernel(dot)alert" <kernel(dot)alert(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: problem with uniques and foreing keys
Date: 2006-05-06 18:43:48
Message-ID: e24c449c0605061143p3e17264dsee6c8b0718836204@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
Sorry i had a mistake in the post it was with the definition of the primary
key in the empresa table...

I'm having the same error when i build the last table...


thanks for your answers...


Hi list...
>
> Please i have a problem with this...
>
> I create the follow tables...
>
> --------------------------------------------------------
>
> CREATE TABLE empresa (
>   id_empresa         integer  NOT NULL primary key,
>   nombre             varchar(45),
>

      primary key(id_empresa)

);
> CREATE TABLE casino (
>   id_casino          integer  NOT NULL,
>   id_empresa         integer      REFERENCES empresa(id_empresa),
>
>   nombre             varchar(45),
>
>   primary key(id_casino,id_empresa)
> );
> CREATE TABLE maq_casino (
>   id_empresa      integer  NOT NULL REFERENCES  casino(id_empresa),
>   id_casino       integer  NOT NULL REFERENCES  casino(id_casino),
>
>   ubicacion_sala     varchar(45) default NULL,
>   primary key(id_empresa,id_casino,id_tipo_maquina,id_maq_casino)
> );
>
> --------------------------------------------------------
>
> When i'm gonna to create the last table i got this error:
>



ERROR:  no hay restriccion unique que coincida con las columnas dadas en la
> tabla referida <<casino>>
>
> That in english is like .. there is no a unique constraint with columns
> referred  in casino table.
>
>
> Please where is the problem...
>
> Greetings ...
>
> Krackem
>
>
>

In response to

pgsql-sql by date

Next:From: Stephan SzaboDate: 2006-05-06 18:57:39
Subject: Re: problem with uniques and foreing keys
Previous:From: Bruno Wolff IIIDate: 2006-05-06 17:56:35
Subject: Re: problem with uniques and foreing keys

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