Re: Query to get name a data type of a view

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: stan <stanb(at)panix(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query to get name a data type of a view
Date: 2020-05-22 15:16:34
Message-ID: CAKFQuwbmRcw8R+WGVMtc36cOTsQ_oSJBXw7WFi43VDEurSLOOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, May 22, 2020, stan <stanb(at)panix(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Kane 2020-05-22 15:16:48 Re: btree_gist extension - gbt_cash_union return type
Previous Message Andrus 2020-05-22 15:16:28 Re: Query returns no rows in pg_basebackup cluster