agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Eugene Yin <eugeneymail@ymail.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: To get the column names, data types, and nullables of tables in the schema owned by MASTER_USER
Date: Thu, 7 Jan 2016 20:22:26 +0000 (UTC)
Message-ID: <751099510.1801394.1452198146367.JavaMail.yahoo@mail.yahoo.com> (raw)
References: <751099510.1801394.1452198146367.JavaMail.yahoo.ref@mail.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

PostgreSQL ver: 9.4.5         OS: LinuxGOAL: To get the column names, data types, and nullables of tables in the schema owned by MASTER_USERIn Oracle, I can use the following statement:select 
    t.table_name,
    t.column_name,
    t.data_type,
    t.NULLABLE,
    (SELECT col.column_name
     FROM all_constraints cons, all_cons_columns col
     WHERE col.table_name = t.table_name
                        AND cons.constraint_type = 'P'
                        AND cons.constraint_name = col.constraint_name
                        AND cons.owner = col.owner and cons.owner = 'MASTER_USER'
    )  Primary_Key_Columnfrom user_tab_columns t;Now, I am on Postgres (9.4.5). How can I convert the above statement into the equivalent SQL  on Postgres?
ThanksEugene

view thread (2+ messages)  latest in thread

Message-ID: <751099510.1801394.1452198146367.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../751099510.1801394.1452198146367.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/751099510.1801394.1452198146367.JavaMail.yahoo@mail.yahoo.com

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eugeneymail@ymail.com
  Subject: Re: To get the column names, data types, and nullables of tables in the schema owned by MASTER_USER
  In-Reply-To: <751099510.1801394.1452198146367.JavaMail.yahoo@mail.yahoo.com>

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

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