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 1jcAKn-0000XS-2I for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 16:15:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jcAKl-0007dd-ND for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 16:15:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jcAKk-0007dJ-VD for pgsql-general@lists.postgresql.org; Fri, 22 May 2020 16:15:42 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jcAKe-0005AP-Nz for pgsql-general@postgresql.org; Fri, 22 May 2020 16:15:41 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 49TBRW0HY0z1VgL for ; Fri, 22 May 2020 12:15:35 -0400 (EDT) Received: by panix5.panix.com (Postfix, from userid 17622) id 49TBRV6c71zfYt; Fri, 22 May 2020 12:15:34 -0400 (EDT) Date: Fri, 22 May 2020 12:15:34 -0400 From: stan To: pgsql-general@postgresql.org Subject: How to get the OID of a view Message-ID: <20200522161534.GA29059@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 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