Thom Brown <t...@linux.com> writes:
> On Thu, 2 May 2024 at 12:40, Durumdara <durumd...@gmail.com> 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


Reply via email to