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 1s2Un8-003U8W-Hn for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2024 11:39:58 +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 1s2Un5-00HYMC-Ul for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2024 11:39:56 +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 1s2Un5-00HYM3-Ju for pgsql-general@lists.postgresql.org; Thu, 02 May 2024 11:39:56 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s2Umz-0014jU-Qh for pgsql-general@postgresql.org; Thu, 02 May 2024 11:39:55 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2e20f2db068so2579831fa.2 for ; Thu, 02 May 2024 04:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714649988; x=1715254788; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=v7xqKLZZzcFpyndBzMxcPVlboyqx3E8dHibPQOao23g=; b=Ey6CEFWy+pjgXxbA61+xdMoA8owi/4SCqcT0HV/L2wOa/cUJjUYIjw+SiMtWEKXL5t eBfY7HEzpfn7T84WnonWTxcPQG4nK8q2JqNP06gMqGDOJzIAav2CPiErmMvPcHPIZuT+ cSnqV3jEqaRnsaqvOv6LtsUJIMg+pWRGbNXZ6vaOLmWIGZfE1qVnrUpvkwDFXiDov8Kc lkTzSOM1WD0UqecAEm+eZ66gZqyEiRnBgCanPElQTeu7XqYxjtCvLw/Ffu8gK8KVk7bS mFOirfDYUdz29eEDkWxouSlbOymjmX4ZEBzWL2ho73gOvSIL8Pli5EQfe3l+9cAUPsWw kPuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714649988; x=1715254788; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=v7xqKLZZzcFpyndBzMxcPVlboyqx3E8dHibPQOao23g=; b=tG/WoDDoUmtHDQ7zEOv99G6tLTtKktsF5KtuLNbXub74yzdTTCCUsCiknsifYMNXn6 KpiNY8r4lq5CbsJUQXTRmBJEfUofvd1gTKomtAjxOM0rVqwFITRyI+TUnWS+JRH3a1Kb /YsMIU0sjK4LwdEGmLrkIyOPjcLPQy1J7WCGhihlwv+nJcaD4kmrvHPs33LikH99M9Kg QjfScsutVACz5m80Kpv+ujM1VDjKrj87JSd6AcIWsw9873xoRU3X7vRNeNG3oXv9DK10 xwr66OgRihpmPU7sn7VpU4M1fX71RGKaRfpxlxpa7d14vttSja25u43IZoceRODLfCyI TGIA== X-Gm-Message-State: AOJu0Yym0Sfrwkn3nJVoNVSgFjdVfRU6FXBdQp81kkngPxaa8d33iw7R D6zf5iMmZodQAmAd6ikEPq4D3LTGB2I5j7iFdgK4Ao1qsgMyJWjZV/Fwey2gFXoxGZLji6iuFYR zMzflThEId6krJndJHsRjPNTEgQ9zX9yN X-Google-Smtp-Source: AGHT+IFtLstjtyJjdpIv6jziDEtASeyDpYE8avOEA2DEs6sjQyuJZgVq9sfR0zI5qmAJbjY7g0hHqkF1FoGNLUkrztM= X-Received: by 2002:a05:651c:1a07:b0:2df:6524:581a with SMTP id by7-20020a05651c1a0700b002df6524581amr3948758ljb.30.1714649987419; Thu, 02 May 2024 04:39:47 -0700 (PDT) MIME-Version: 1.0 From: Durumdara Date: Thu, 2 May 2024 13:39:36 +0200 Message-ID: Subject: Listing only the user defined types (with owners) To: Postgres General Content-Type: multipart/alternative; boundary="0000000000006a352e0617770fb9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006a352e0617770fb9 Content-Type: text/plain; charset="UTF-8" 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 --0000000000006a352e0617770fb9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

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

I select = the tables like this:

=C2= =A0 =C2=A0 FOR r IN SELECT tablename FROM pg_tables WHERE (schemaname =3D &= #39;public') and (tableowner <> act_dbowner)
=C2=A0 =C2=A0 LOO= P
...

For types I found pg_ty= pe, but this contains all types.

For example I hav= e only one user defined type, like "T_TEST", but this pg_type rel= ation contains the basic data types,=C2=A0 other data types, from any schem= a.

Do you have a working Query which lists the use= r defined types with the owners?

Thank you for=C2= =A0your help!

Best regards
dd
=

--0000000000006a352e0617770fb9--