pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dba <dbadbb@gmail.com>
To: pgsql-admin@postgresql.org
Subject: setting foreigh key for an array.
Date: Mon, 14 Feb 2011 02:56:21 -0800 (PST)
Message-ID: <1297680981226-3384263.post@n5.nabble.com> (raw)





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.



view thread (3+ messages)  latest in thread

Message-ID: <1297680981226-3384263.post@n5.nabble.com>
Permalink:  ../1297680981226-3384263.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1297680981226-3384263.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: dbadbb@gmail.com
  Subject: Re: setting foreigh key for an array.
  In-Reply-To: <1297680981226-3384263.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox