Skip site navigation (1) Skip section navigation (2)

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: beta4 accepts foreign key of different type than column
Date: 2008-01-06 15:10:41
Message-ID: 20080106151041.GA21029@apartia.fr (view raw or flat)
Thread:
Lists: pgsql-hackers
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

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2008-01-06 15:18:35
Subject: Re: beta4 accepts foreign key of different type than column
Previous:From: Euler Taveira de OliveiraDate: 2008-01-06 14:25:00
Subject: Re: pg 8.3 Windows installer suggestion

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group