public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Thom Brown <[email protected]>
Cc: Durumdara <[email protected]>
Cc: Postgres General <[email protected]>
Subject: Re: Listing only the user defined types (with owners)
Date: Thu, 02 May 2024 10:15:29 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAA-aLv4sNe7NX3scGhGUvqiwf3cp7wJrYD6GYs8qM=45Vmu9VA@mail.gmail.com>
References: <CAEcMXhki9OkNTSzyKZp9ehPOeCCc3J7hiacA_7=jQi4WYywBaQ@mail.gmail.com>
	<CAA-aLv4sNe7NX3scGhGUvqiwf3cp7wJrYD6GYs8qM=45Vmu9VA@mail.gmail.com>

Thom Brown <[email protected]> writes:
> On Thu, 2 May 2024 at 12:40, Durumdara <[email protected]> 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






view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Listing only the user defined types (with owners)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox