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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-es-ayuda by date

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