Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C419C9FB542 for ; Thu, 19 Jul 2007 15:04:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 26432-05 for ; Thu, 19 Jul 2007 15:04:46 -0300 (ADT) X-Greylist: delayed 00:05:35.354301 by SQLgrey-1.7.5 Received: from cptec.inpe.br (guapira.cptec.inpe.br [150.163.140.191]) by postgresql.org (Postfix) with ESMTP id D19559FAA6E for ; Thu, 19 Jul 2007 15:04:47 -0300 (ADT) Received: from [150.163.140.242] (manoia.cptec.inpe.br [150.163.140.242]) by cptec.inpe.br (8.12.10/8.12.4) with ESMTP id l6JI7wVb020751 for ; Thu, 19 Jul 2007 15:07:58 -0300 (EST) Message-ID: <469FA659.9010606@cptec.inpe.br> Date: Thu, 19 Jul 2007 14:58:49 -0300 From: =?ISO-8859-1?Q?Jos=E9_Roberto_Motta_Garcia?= User-Agent: Thunderbird 1.5 (X11/20060317) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: ALTER TABLE ADD CONSTRAINT Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.078 tagged_above=0 required=5 tests=BAYES_50=0.001, SUBJ_ALL_CAPS=2.077 X-Spam-Level: ** X-Archive-Number: 200707/225 X-Sequence-Number: 26206 Hi all, I do it in table synop: ALTER TABLE synop ADD CONSTRAINT estacoes_fk FOREIGN KEY (id_estacao) REFERENCES estacoes Then I check the DDL and it is like this: .... CONSTRAINT estacoes_fk FOREIGN KEY (id_estacao, id_estacao) REFERENCES estacoes (id_estacao, id_estacao) .... - Why id_estacao is duplicated???? - id_estacao is the only column in pk of estacoes. Tks -- Jose Roberto M. Garcia, MSc Systems Analist - Database Group Voice: (12) 3186-8405 -- http://www.cptec.inpe.br http://www.inpe.br