How to get the OID of a view

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to get the OID of a view
Date: 2020-05-22 16:15:34
Message-ID: 20200522161534.GA29059@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to write a query to return the names, and data types of all the
columns in a view. It has been pointed out to me that the best approach
would be using pg_catalog. OK, so I found pg_view, which I can get the names
of a the views from and pg_attribute which can give me the column names,
but it looks like i need to join this on OID, and pg_table does not have
that data.

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-05-22 16:24:15 Re: How to get the OID of a view
Previous Message Adrian Klaver 2020-05-22 16:12:07 Re: pg_dump crashes