X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E7E4C9FA2C3 for ; Sat, 6 May 2006 14:27:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 93526-05 for ; Sat, 6 May 2006 14:27:44 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by postgresql.org (Postfix) with ESMTP id 9DFD89F9C9E for ; Sat, 6 May 2006 14:27:43 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id m3so1212129ugc for ; Sat, 06 May 2006 10:27:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=ELAYPPgvo+kfW5Z1QKAumqkpq+ZIx1M0qYW0TQ/UJoJmOxtZ0FmSrIM57d2FY95rDngrqVSqjUdokSKuTR0jDfut8/FWwgZ4ZMzIZ0fUfvkkl+91I+4zXBxbWHuFHatUmYRhbCnDcEr8rQlCUZz0q6Ne2NOwGX+ekDERIU1dW3M= Received: by 10.78.67.20 with SMTP id p20mr232309hua; Sat, 06 May 2006 10:27:42 -0700 (PDT) Received: by 10.78.45.17 with HTTP; Sat, 6 May 2006 10:27:41 -0700 (PDT) Message-ID: Date: Sat, 6 May 2006 12:27:41 -0500 From: "kernel.alert kernel.alert" To: pgsql-sql@postgresql.org Subject: problem with uniques and foreing keys MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15109_27185888.1146936461989" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/66 X-Sequence-Number: 25097 ------=_Part_15109_27185888.1146936461989 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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), ); 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 <> That in english is like .. there is no a unique constraint with columns referred in casino table. Please where is the problem... Greetings ... Krackem ------=_Part_15109_27185888.1146936461989 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi list...

Please i have a problem with this...

I create the = follow tables...

---------------------------------------------------= -----

CREATE TABLE empresa (
  id_empresa   &= nbsp;     integer  NOT NULL primary key,
  nombre         &nbs= p;   varchar(45),
);
CREATE TABLE casino (
  id_cas= ino          integer  NOT= NULL,
  id_empresa        = integer      REFERENCES empresa(id_empresa),
<= br>  nombre          = ;   varchar(45),

  primary key(id_casino,id_empresa)
);
CREATE TABLE maq_= casino (
  id_empresa      integer  N= OT 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)<= br>);

--------------------------------------------------------
When i'm gonna to create the last table i got this error:

ERROR:  no hay restriccion unique que coincida con las columna= s dadas en la tabla referida <<casino>>

That in english = is like .. there is no a unique constraint with columns referred  in c= asino table.


Please where is the problem...

Greetings ...

Krac= kem


------=_Part_15109_27185888.1146936461989--