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
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:
Postgres_find_FKey_data_type_mismatch.sql
Description: Binary data
-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general