Query to find Foreign Key column data type mismatch - Mailing list pgsql-general

From Gurjeet Singh
Subject Query to find Foreign Key column data type mismatch
Date
Msg-id 65937bea0905312336x20623976jcc64d144cb547d5d@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi All,

    I wanted to find out if both the ends of a foreign key reference were using the same data types, since, in older versions, not having the same data types can lead to Postgres not picking the appropriate index, and in newer versions also it would be beneficial since having same data types can avoid having to go through conversion functions for comparisons etc.

    So I devised this query and the helper function for the purpose. Just create the function and then run the query. This query checks all the foreign keys in the database.

    Feedback/comments welcome.

Best regards,
--
Lets call it Postgres

EnterpriseDB      http://www.enterprisedb.com

gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com
Mail sent from my BlackLaptop device
Attachment

pgsql-general by date:

Previous
From: j-lists
Date:
Subject: Foreign key verification trigger conditions
Next
From: Andrew Smith
Date:
Subject: Re: newbie table design question