Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s2XHk-003pv5-9j for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2024 14:19:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s2XHg-000qEb-V2 for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2024 14:19:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s2XHg-000qAC-Ji for pgsql-general@lists.postgresql.org; Thu, 02 May 2024 14:19:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s2XHe-0015ow-QL for pgsql-general@postgresql.org; Thu, 02 May 2024 14:19:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 442EFTfY2204952; Thu, 2 May 2024 10:15:29 -0400 From: Tom Lane To: Thom Brown cc: Durumdara , Postgres General Subject: Re: Listing only the user defined types (with owners) In-reply-to: References: Comments: In-reply-to Thom Brown message dated "Thu, 02 May 2024 13:28:56 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2204950.1714659329.1@sss.pgh.pa.us> Date: Thu, 02 May 2024 10:15:29 -0400 Message-ID: <2204951.1714659329@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thom Brown writes: > On Thu, 2 May 2024 at 12:40, Durumdara wrote: >> Do you have a working Query which lists the user defined types with the >> owners? > You can always cheat and copy what psql does when you tell it to list all > user types with extended output (\dt+): If you want to look at what SQL psql issues for a \d-type command, you don't even need to look at the server log. Just start psql with the -E (--echo-hidden) switch. $ psql -E psql (17devel) Type "help" for help. postgres=# \dT+ /******** QUERY *********/ SELECT n.nspname as "Schema", pg_catalog.format_type(t.oid, NULL) AS "Name", t.typname AS "Internal name", CASE WHEN t.typrelid != 0 THEN CAST('tuple' AS pg_catalog.text) WHEN t.typlen < 0 THEN CAST('var' AS pg_catalog.text) ELSE CAST(t.typlen AS pg_catalog.text) END AS "Size", ... etc etc ... regards, tom lane