http://www.postgresql.org/docs/9.4/static/ddl-constraints.html

A foreign key can also constrain and reference a group of columns. As
usual, it then needs to be written in table constraint form. Here is a
contrived syntax example:

CREATE TABLE t1 (
  a integer PRIMARY KEY,
  b integer,
  c integer,
  *FOREIGN KEY (b, c) REFERENCES other_table (c1, c2)*
);


--
Everton

2015-01-19 17:36 GMT-02:00 Matheus Saraiva <[email protected]>:

>  Como faço para criar uma chave estrangeira que aponte para uma tabela que
> tem chave primária composta?
>
> --
> *Chapecó - SC*
>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
>
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a