Re: Listing only the user defined types (with owners)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Listing only the user defined types (with owners)
Дата
Msg-id 2204951.1714659329@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Listing only the user defined types (with owners)  (Thom Brown <thom@linux.com>)
Список pgsql-general
Thom Brown <thom@linux.com> writes:
> On Thu, 2 May 2024 at 12:40, Durumdara <durumdara@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



В списке pgsql-general по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Prevent users from executing pg_dump against tables
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: How to interpret 'depends on' errors in pg_restore?