Re: Query to get name a data type of a view - Mailing list pgsql-general

From David G. Johnston
Subject Re: Query to get name a data type of a view
Date
Msg-id CAKFQuwbmRcw8R+WGVMtc36cOTsQ_oSJBXw7WFi43VDEurSLOOQ@mail.gmail.com
Whole thread Raw
In response to Query to get name a data type of a view  (stan <stanb@panix.com>)
List pgsql-general
On Friday, May 22, 2020, stan <stanb@panix.com> wrote:
When I run the following query,


SELECT column_name,data_type
FROM information_schema.columns
WHERE table_name = 'mfg_part_view';


I get the following result:

 column_name  |     data_type     
 --------------+-------------------
  mfg          | USER-DEFINED
  mfg_part_no  | character varying
  unit         | USER-DEFINED


I need to return the name, and data type of each column for the specified
view.

Use the pg_catalog schema “tables” directly instead of the SQL standard information_schema view.  The later doesn’t provide detail of PostgreSQL-specific features by definition.

David J.

pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: Query returns no rows in pg_basebackup cluster
Next
From: Tim Kane
Date:
Subject: Re: btree_gist extension - gbt_cash_union return type