Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc9KY-0007JC-1W for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 15:11:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jc9KX-00022m-0P for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 15:11:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc9KW-00022f-PC for pgsql-general@lists.postgresql.org; Fri, 22 May 2020 15:11:24 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc9KP-0007IW-VH for pgsql-general@postgresql.org; Fri, 22 May 2020 15:11:24 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 49T91H3JyRz175x for ; Fri, 22 May 2020 11:11:15 -0400 (EDT) Received: by panix5.panix.com (Postfix, from userid 17622) id 49T91H2CqjzfYt; Fri, 22 May 2020 11:11:15 -0400 (EDT) Date: Fri, 22 May 2020 11:11:15 -0400 From: stan To: pgsql-general@postgresql.org Subject: Query to get name a data type of a view Message-ID: <20200522151115.GA18237@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 descrip | character varying mfg_part_key | integer (5 rows) The SQL that creates this view is as follows: CREATE VIEW mfg_part_view as select mfg.name as mfg , mfg_part.mfg_part_no , costing_unit.unit , mfg_part.descrip , mfg_part.mfg_part_key from mfg_part right join costing_unit on mfg_part.unit_key = costing_unit.costing_unit_key inner join mfg on mfg.mfg_key = mfg_part.mfg_key WHERE mfg_part is NOT NULL ORDER BY mfg.name , mfg_part.mfg_part_no ; Clearly that is not what I expected :-) I need to return the name, and data type of each column for the specified view. How can I do this? -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin