Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EEBD4650384 for ; Fri, 25 Jul 2008 19:32:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12387-04 for ; Fri, 25 Jul 2008 19:31:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128088.authsmtp.com (outmail128088.authsmtp.com [62.13.128.88]) by postgresql.org (Postfix) with ESMTP id 8EC6C64FD03 for ; Fri, 25 Jul 2008 19:32:03 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt5.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m6PMVvic065761; Fri, 25 Jul 2008 23:31:57 +0100 (BST) Received: from josh-berkuss-macbook.local ([12.157.240.2]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m6PMVlRd021040; Fri, 25 Jul 2008 23:31:49 +0100 (BST) Message-ID: <488A545B.4070609@agliodbs.com> Date: Fri, 25 Jul 2008 15:31:55 -0700 From: Josh Berkus User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Gauri Kanekar CC: pgsql-performance@postgresql.org Subject: Re: Partitioned Tables Foreign Key Constraints Problem References: <7e4ba9550807240315q22c955a7t4c3895b94aa2138d@mail.gmail.com> In-Reply-To: <7e4ba9550807240315q22c955a7t4c3895b94aa2138d@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Server-Quench: 78fa4f30-5a99-11dd-8155-001185d377ca X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkGMA9GIUINWEQL c1AAcx1xLVlbHwkB C3YJWF5XUVd1UC10 aRRQaAJDYE5OQQd1 Uk1LR01SWlhuYWFn WnxKUhtzdwFGNnZ4 YAhlViYKWBJ5dVt4 E0ddCGwHMTN9YGEa VV1YdwJVeAYefRhC OQExNiYHcQ5nExgW ODUWCngJNC9DKThU RQcAIRouSEwPEyV0 aRcYEDQgGwUmSjR7 BBsgMUIGFUcXLl56 CUEmU1YVNndp X-Authentic-SMTP: 61633136333939.squirrel.dmpriest.net.uk:1186/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.41 tagged_above=0 required=5 tests=SUBJECT_FUZZY_TION=0.41 X-Spam-Level: X-Archive-Number: 200807/226 X-Sequence-Number: 30826 Gauri, > How can we define the Foreign_key constraint on "other_tbl" based upon > any partitioned table field. Currently PostgreSQL doesn't have any simple way to support this. There are a few workarounds, but they're fairly awkward, such as a trigger to check if the ID is correct. --Josh