pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: linktosunilsingh@gmail.com
Subject: BUG #15296: Not able to get query result "information_schema.constraint_column_usage"
Date: Thu, 26 Jul 2018 10:26:31 +0000
Message-ID: <153260079181.1396.3862360052638574921@wrigleys.postgresql.org> (raw)

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.



Message-ID: <153260079181.1396.3862360052638574921@wrigleys.postgresql.org>
Permalink:  ../153260079181.1396.3862360052638574921@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/153260079181.1396.3862360052638574921@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, linktosunilsingh@gmail.com
  Subject: Re: BUG #15296: Not able to get query result "information_schema.constraint_column_usage"
  In-Reply-To: <153260079181.1396.3862360052638574921@wrigleys.postgresql.org>
  References: <153260079181.1396.3862360052638574921@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox