my bad (was: Re: beta4 accepts foreign key of different type than column

From: Louis-David Mitterrand <vindex+lists-pgsql-hackers(at)apartia(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: my bad (was: Re: beta4 accepts foreign key of different type than column
Date: 2008-01-06 15:59:32
Message-ID: 20080106155932.GA22841@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 06, 2008 at 10:18:35AM -0500, Andrew Dunstan wrote:
> Louis-David Mitterrand wrote:
>> Hi,
>>
>> I changed the data type on a column (to an enum) but the previous
>> foreign key to the old table (replaced by the enum) is still accepted
>> event though the data types are now different. Is that the expected
>> behavior?
>>
>> CREATE TABLE person_to_event (
>> id_person integer NOT NULL,
>> id_event integer NOT NULL,
>> person_type person_type_new NOT NULL, -- new ENUM type
>> "character" text
>> )
>>
>> ALTER TABLE ONLY person_to_event
>> ADD CONSTRAINT person_to_event_person_type_fkey FOREIGN KEY (person_type) REFERENCES person_type(person_type); -- old person_type table, text column
>>
> Please send us a more complete example. Also, using the same name for a
> table, a field and a type makes reading it very confusing. Please make
> sure your example uses names for just one purpose.

Sorry, false alarm. I just realised that I had previously also changed
the person_type.person_type data type to the same enum.

Cheers,

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-01-06 16:07:40 Re: beta4 accepts foreign key of different type than column
Previous Message Andrew Dunstan 2008-01-06 15:18:35 Re: beta4 accepts foreign key of different type than column