Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Marcio A. Sepp
> Em 24 de nov de 2017, às 21:06, Leandro Guimarães Faria Corcete DUTRA > escreveu: > >> Le ven. 24 nov. 2017 à 19:09, Marcio A. Sepp >> a écrit : >> o campo c2t2 ele eh a chave natural para a tabela. Soh pensei em talvez >> utilizar os dois

Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Leandro Guimarães Faria Corcete DUTRA
Le ven. 24 nov. 2017 à 19:09, Marcio A. Sepp a écrit : o campo c2t2 ele eh a chave natural para a tabela. Soh pensei em talvez utilizar os dois campos na chave por motivo de acoplamento para as tabelas que se referenciarem a t2 Então realmente está errado. Uma

Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Marcio A. Sepp
> Em 24 de nov de 2017, às 17:13, Leandro Guimarães Faria Corcete DUTRA > escreveu: > >> Le vendredi 24 novembre 2017 à 16:46 -0200, Márcio A. Sepp a écrit : >> >> create table t2 >> ( c1t1 integer, >> c2t2 integer, >> c3t2 integer, >> primary key (c1t1, c2t2), >> foreign

Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Leandro Guimarães Faria Corcete DUTRA
Le vendredi 24 novembre 2017 à 15:58 -0300, Tiago Brasil a écrit : > > create table t2 > ( c1t1 integer, > c2t2 integer, > c3t2 integer, > primary key (c1t1, c2t2), > foreign key (c1t1) references t1 (c1t1), > unique (c2t2)); **n necessita dessa linha visto que primary key ja > sao unique e

Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Leandro Guimarães Faria Corcete DUTRA
Le vendredi 24 novembre 2017 à 16:46 -0200, Márcio A. Sepp a écrit : > > create table t2 > ( c1t1 integer, > c2t2 integer, > c3t2 integer, > primary key (c1t1, c2t2), > foreign key (c1t1) references t1 (c1t1), > unique (c2t2)); Chave primária (PRIMARY KEY) e alternativa (UNIQUE) são

Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Fabrízio de Royes Mello
Em 24 de novembro de 2017 16:58, Tiago Brasil escreveu: > > > create table t2 > ( c1t1 integer, > c2t2 integer, > c3t2 integer, > primary key (c1t1, c2t2), > foreign key (c1t1) references t1 (c1t1), > unique (c2t2)); **n necessita dessa linha visto que primary key ja sao

Re: [pgbr-geral] Definição

2017-11-24 Por tôpico Tiago Brasil
create table t2 ( c1t1 integer, c2t2 integer, c3t2 integer, primary key (c1t1, c2t2), foreign key (c1t1) references t1 (c1t1), *unique (c2t2)); **n necessita dessa linha visto que primary key ja sao unique e not null por padrão* *De resto está correto.* 2017-11-24 15:46 GMT-03:00 Márcio A.