Thread: BUG #15296: Not able to get query result"information_schema.constraint_column_usage"
BUG #15296: Not able to get query result"information_schema.constraint_column_usage"
From
PG Bug reporting form
Date:
The following bug has been logged on the website: Bug reference: 15296 Logged by: sunil singh Email address: linktosunilsingh@gmail.com PostgreSQL version: 10.4 Operating system: windows 10 64 Bit Description: I have database name XXX_product and schema name as XXX_product and there is a table "table_name" in schema XXX_product.The user I defined for XXX_product and XXX_schema is user_postgres. Below query giving me the 0 rows. "select tc.table_name AS TABLE_NAME, kcu.column_name AS COLUMN_NAME,ccu.table_name AS REFERENCED_TABLE_NAME,ccu.column_name AS REFERENCED_COLUMN_NAME FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_schema = kcu.table_schema JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name AND ccu.table_schema = tc.table_schema WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name='table_name' " But when I am not using "JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name AND ccu.table_schema = tc.table_schema" in the query I am getting the result.