Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 43EA36326BC for ; Mon, 6 Sep 2010 21:23:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 49348-07 for ; Tue, 7 Sep 2010 00:23:42 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 311036327A3 for ; Mon, 6 Sep 2010 21:23:42 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id o870NfWb053987 for ; Mon, 6 Sep 2010 21:23:41 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id o870M9sA053602 for pgsql-admin@postgresql.org; Mon, 6 Sep 2010 21:22:09 -0300 (ADT) (envelope-from news) From: Lew X-Newsgroups: pgsql.admin Subject: Re: problem with foreign key Date: Mon, 06 Sep 2010 20:22:22 -0400 Organization: albasani.net Lines: 17 Message-ID: References: <4C83FAD2.6050906@chello.at> <4C84025C.1060606@chello.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit In-Reply-To: <4C84025C.1060606@chello.at> Cancel-Lock: sha1:Hz7T4dsXAP5MmjYKt4/+ukMTJoQ= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 Injection-Info: news.albasani.net; logging-data="VXPNaO2BCjJX5431HRbqfKzQcnW0E1QCFKGpcSUkmEShaJvShGKmtoOJ1lJ9P6e8HCUQ45K4OJ//pRliaQjFA3Jq7hKhZZjVEcJtATr7JWigHUmcmqHB2aH4sYzgHhZd"; mail-complaints-to="abuse@albasani.net" To: pgsql-admin@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/48 X-Sequence-Number: 35592 Please do not top-post. Bèrto ëd Sèra wrote: >> An immediate question: did you check that Key (docuuserid)=(8415) is >> actually present in table "trade"? Ljubomir Erdeljan wrote: > This relate to different column names > docuuserid is column in porder1 but relate to tradeid in trade. You missed the point. Did you check that the key is present in "trade"? IOW, is there a row in "trade" with "tradeid" equal to 8415? If not, you cannot create the foreign key because the item in "porder1" cannot point to it. -- Lew