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

Re: [pgsql-ayuda] Foreign key

From: José Soares <sferac(at)bo(dot)nettuno(dot)it>
To: pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Cc: pgsql-ayuda(at)campus(dot)iztacala(dot)unam(dot)mx
Subject: Re: [pgsql-ayuda] Foreign key
Date: 1999-03-29 12:30:52
Message-ID: 36FF727C.B8B4E6F0@bo.nettuno.it (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
cesar ha scritto:

> Hola,
> puede SQL definir foreign keys en una table ?
>

-- Claro que si.

>
> Como ??

--Asi:

> FOREIGN KEY <Table Constraint> definition ::=
>      [ CONSTRAINT <Constraint name> ]
>      FOREIGN KEY (referencing <Column name> [,<Column name>...])
>           REFERENCES referenced <Table name>
>                [ (referenced <Column name> [,<Column name>...]) ]
>           [ MATCH {FULL | PARTIAL} ]
>           [ ON UPDATE <action> ]
>           [ ON DELETE <action> ]
>           [ ON UPDATE <action> ]
>      [ <Constraint attributes> ]
>
>                <action> ::=
>                     NO ACTION |
>                     CASCADE |
>                     SET NULL |
>                     SET DEFAULT

> FOREIGN KEY <Column Constraint> definition ::=
>  [ CONSTRAINT <Constraint name> ]
>  REFERENCES referenced <Table name>
>  [ (referenced <Column name> [,<Column name>...]) ]
>  [ MATCH {FULL | PARTIAL} ]
>  [ ON UPDATE <action> ]
>  [ ON DELETE <action> ]
>  [ ON UPDATE <action> ]
>  [ <Constraint attributes> ]
>
>
> Ejemplo:

> -- CREATE TABLE table2 (
>      column1 SMALLINT,
>      CONSTRAINT constraint1
>           FOREIGN KEY(column1) REFERENCES table1);
>

La Foreign Key todavia no esta implementada en PostgreSQL, el reconoce
solamente parte de la sintax.

>
>
> Gracias
>

De nada.
Jose'

--------- Pie de mensaje -------------------------------------------
Archivo historico: http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
Cancelar inscripcion:
mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
text   : cancelacion pgsql-ayuda

In response to

pgsql-es-ayuda by date

Next:From: José SoaresDate: 1999-03-29 12:58:08
Subject: Re: [pgsql-ayuda] IIF y procedimientos almacenados...
Previous:From: José SoaresDate: 1999-03-29 12:17:51
Subject: Re: [pgsql-ayuda] Simple y vulgar delete ... NO SE DEJA !!!

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