Re: inserting lots of values into a column that has "unique" property

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Fehmi Noyan ISI <fnoyan(at)linuxmail(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: inserting lots of values into a column that has "unique" property
Date: 2004-06-14 15:49:03
Message-ID: 20040614154903.GB8883@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jun 14, 2004 at 01:07:09 +0800,
Fehmi Noyan ISI <fnoyan(at)linuxmail(dot)org> wrote:
>
> I got the error message as expected. Everything is ok.Now, let's create
> another table called "table_2" with an inheritence from "table_1".
>
> But, when I insert a new value into "table_2" with an "id" value same
> as with one of the values in "table_1"...
>
> I think, I must get an error message like the message above (when I try
> to insert a new value directly into "table_1" with a same "id" value).
> There are two same "id"s with the value "1" although the "id" column is
> defined as UNIQUE.
> If I use "PRIMARY KEY" instead of "UNIQUE NOT NULL", the same thing
> happens.Nothing changes!

This is a deficiency in how inherited tables work. This will not be fixed
in the upcoming 7.5 release. If you need this, you may be better off
using views (of joined tables) rather than inherited tables.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-06-14 16:25:47 BUG #1163: cursor "jdbc_curs_1" does not exist
Previous Message Tom Lane 2004-06-14 15:25:47 Re: \w doesn't match non-ASCII letters