FK data type ("Changing foreign key attribute is not allowed")

Hi all
Not sure if this is feature request, bug report or just up for general discussion.
I think different data types should be allowed for FK fields.
In some cases, the data type of the FK is not the same as the data type of the referenced field.
For instance, in cases where I have a FK field in the "child" table that links to a PK on the "parent" table and that PK field is of type SERIAL, I
usually declare the FK field as INTEGER (or BIGINT for BIGSERIAL).
Regards



Login or register to post comments

Comments

allowing compatible types in FK

frankly, we haven't thought of that before. It shouldn't be too difficult and we might be able to support it pretty soon.

thanks for your input. :)

Workaround

The workaround to this issue is to change "serial" into "integer" + default value set to predefined sequence (in fact - this is the same what "serial" means - this "pseudo type" is changed into integer + sequence). However such improvements will be great :-)