Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F34101337B80 for ; Mon, 14 Feb 2011 07:15:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 71407-03 for ; Mon, 14 Feb 2011 11:15:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id A7B831337B90 for ; Mon, 14 Feb 2011 07:15:13 -0400 (AST) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1Pow6P-0000Qw-91 for pgsql-admin@postgresql.org; Mon, 14 Feb 2011 02:56:21 -0800 Date: Mon, 14 Feb 2011 02:56:21 -0800 (PST) From: dba To: pgsql-admin@postgresql.org Message-ID: <1297680981226-3384263.post@n5.nabble.com> Subject: setting foreigh key for an array. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.767 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201102/113 X-Sequence-Number: 36752 I have a requirement. Created table called a. CREATE TABLE a(no int primary key,name text); Need to create reference key for no field of array. which is belongs to b table. The postgresql is not allowing to create a reference for incompatible type. CREATE TABLE d(no int[] references a,name text); ERROR: foreign key constraint "d_no_fkey" cannot be implemented DETAIL: Key columns "no" and "no" are of incompatible types: integer[] and integer. Is there any solution to setting foreign key for an array. NOTE: Kindly ensure that I don't want to change the int to int[] in a table. -- View this message in context: http://postgresql.1045698.n5.nabble.com/setting-foreigh-key-for-an-array-tp3384263p3384263.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.