BUG #15296: Not able to get query result "information_schema.constraint_column_usage"

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: linktosunilsingh(at)gmail(dot)com
Subject: BUG #15296: Not able to get query result "information_schema.constraint_column_usage"
Date: 2018-07-26 10:26:31
Message-ID: 153260079181.1396.3862360052638574921@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15296
Logged by: sunil singh
Email address: linktosunilsingh(at)gmail(dot)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.

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-07-26 13:35:27 BUG #15297: Irregular comparison rules for NULLs in tuples
Previous Message Victor Yegorov 2018-07-26 10:23:01 Re: BUG #15290: Stuck Parallel Index Scan query