Listing only the user defined types (with owners)

From: Durumdara <durumdara(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Listing only the user defined types (with owners)
Date: 2024-05-02 11:39:36
Message-ID: CAEcMXhki9OkNTSzyKZp9ehPOeCCc3J7hiacA_7=jQi4WYywBaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello!

I have a script which can change the table owners to the database owner.

I select the tables like this:

FOR r IN SELECT tablename FROM pg_tables WHERE (schemaname = 'public')
and (tableowner <> act_dbowner)
LOOP
...

For types I found pg_type, but this contains all types.

For example I have only one user defined type, like "T_TEST", but this
pg_type relation contains the basic data types, other data types, from any
schema.

Do you have a working Query which lists the user defined types with the
owners?

Thank you for your help!

Best regards
dd

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kashif Zeeshan 2024-05-02 12:06:35 Re: Listing only the user defined types (with owners)
Previous Message Ron Johnson 2024-05-02 09:24:47 Re: Linked directory or explicit reference