Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C25149FCB65 for ; Thu, 8 Nov 2007 12:45:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 06209-04 for ; Thu, 8 Nov 2007 12:45:37 -0400 (AST) Received: from yertle.kcilink.com (thingy.kcilink.com [74.92.149.59]) by postgresql.org (Postfix) with ESMTP id 6A58F9FCB5D for ; Thu, 8 Nov 2007 12:45:46 -0400 (AST) Received: from host-121.int.kcilink.com (host-121.int.kcilink.com [192.168.7.121]) by yertle.kcilink.com (Postfix) with ESMTP id E692BC947D for ; Thu, 8 Nov 2007 11:45:45 -0500 (EST) Message-Id: From: Vivek Khera To: pgsql-sql@postgresql.org In-Reply-To: <87ejf57v28.fsf@ttnet.net.tr> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v912) Subject: Re: Partitioning and Foreign Keys Date: Thu, 8 Nov 2007 11:45:45 -0500 References: <87ejf57v28.fsf@ttnet.net.tr> X-Mailer: Apple Mail (2.912) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/26 X-Sequence-Number: 29554 On Nov 4, 2007, at 12:57 PM, Volkan YAZICI wrote: > major bottleneck. I planned to partition this table, but I learnt that > PostgreSQL doesn't allow referencing views. Does anybody have any > suggestions? > I can envision writing your own custom trigger instead of using the stock FK trigger that knows which sub-table to check for the FK reference. Then add that as an insert/update trigger on your referencing table. I will be investigating this approach in the next few months; right now I don't have need for this particular case.