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 1tEEC4-00669o-Ay for pgsql-admin@arkaria.postgresql.org; Thu, 21 Nov 2024 20:54:28 +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 1tEEC2-001OGp-UK for pgsql-admin@arkaria.postgresql.org; Thu, 21 Nov 2024 20:54:26 +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 1tEEC2-001OGd-EY for pgsql-admin@lists.postgresql.org; Thu, 21 Nov 2024 20:54:26 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEEBy-0036sx-UX for pgsql-admin@lists.postgresql.org; Thu, 21 Nov 2024 20:54:25 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id A64E8380F77; Thu, 21 Nov 2024 21:54:19 +0100 (CET) Received: from rs.plausibolo.de ([127.0.0.1]) by localhost (h2367442.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6oo5C33pv6pX; Thu, 21 Nov 2024 21:54:19 +0100 (CET) Received: from [192.168.178.86] (xdsl-78-35-209-36.nc.de [78.35.209.36]) by rs.plausibolo.de (Postfix) with ESMTPSA id 3A04C3807D3; Thu, 21 Nov 2024 21:54:19 +0100 (CET) Message-ID: <3b9b5142-e80d-e306-4ba0-8a5361a97775@jakobs.com> Date: Thu, 21 Nov 2024 21:54:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: de-DE To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs Subject: Re: Table owner change issue In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------oRkcalH11JJxgK6iZ8k80rql" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------oRkcalH11JJxgK6iZ8k80rql Content-Type: multipart/mixed; boundary="------------koErM8nUXdii5DK0IkT4D4z9"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: <3b9b5142-e80d-e306-4ba0-8a5361a97775@jakobs.com> Subject: Re: Table owner change issue References: In-Reply-To: --------------koErM8nUXdii5DK0IkT4D4z9 Content-Type: multipart/alternative; boundary="------------0se6JzriUk02p40Mt2blLQQn" --------------0se6JzriUk02p40Mt2blLQQn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 QW0gMjEuMTEuMjQgdW0gMjE6NDIgc2NocmllYiBCZW5qYW1pbiBQYXRyaWNrOg0KPiBJIGFt IHVzaW5nIFBHQWRtaW4gNC44LjguwqAgTmV3IHRvIHRoZSBncm91cCBhbmQgaG9waW5nIHRo aXMgdGhlIA0KPiBjb3JyZWN0IGdyb3VwIGZvciBhc3Npc3RhbmNlLg0KPiBNeSBpbnN0YW5j ZSBpcyBhbiBBV1MgaW5zdGFuY2Ugc28gdGhlcmUgaXNuJ3QgYSB2aWFibGUgc3VwZXJ1c2Vy Lg0KPiBJIGhhZCBhIHVzZXIgY3JlYXRlIHRhYmxlIHdpdGggdGhlIHRhYmxlIG93bmVyIGJl aW5nIHRoZW1zZWxmLiANCj4gdXNlci5zY2hlbWEudGFibGVuYW1lDQo+IEkgd2FudGVkIHRv IGNoYW5nZSB0aGUgb3duZXIgdG8gdGhlIGRib3duZXIsIGJ1dCB3YXMgdW5hYmx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IGhhdmUgdHJpZWQuIERv bid0IHR5cGUgdGhlbSwgY29weSB0aGVtIQ0KICAqIEluY2x1ZGUgYWxsIG1lc3NhZ2VzIHlv dSBnZXQgZnJvbSB0aGUgc2VydmVyLg0KICAqIElmIHNvbWV0aGluZyBkb2Vzbid0IHdvcmsg aW4gUEdBZG1pbiwgYWx3YXlzIHRyeSBhZ2FpbiB1c2luZyBwc3FsLA0KICAgIGJlY2F1c2Ug dGhpcyBpcyB0aGUgb25seSBmcm9udGVuZCBtYWludGFpbmVkIGJ5IHRoZSBQb3N0Z3JlU1FM DQogICAgZGV2ZWxvcGVycy4NCg0KSXQncyBub3QgcG9zc2libGUgdG8gY2hhbmdlIG93bmVy c2hpcCBvZiBhbiBvYmplY3QgKHRhYmxlLCB2aWV3LCBzY2hlbWEsIA0KZnVuY3Rpb24sIC4u LikgdG8gYSByb2xlIHlvdSBhcmVuJ3QgYSBtZW1iZXIgb2YuIE90aGVyd2lzZSwgeW91IG1p Z2h0IA0KY2hhbmdlIGl0IGFuZCBsb2NrIHlvdXJzZWxmIG91dC4NCg0KDQpBbmQgb2YgY291 cnNlLCB5b3UgaGF2ZSB0byBiZSBvd25lciBvZiBhbiBvYmplY3QgdG8gYWx0ZXIgaXQuIFVu bGVzcyB5b3UgDQphcmUgYSBzdXBlcnVzZXIuDQoNCg0KS2luZCBSZWdhcmRzLA0KDQoNCkhv bGdlcg0KDQoNCi0tIA0KDQpIb2xnZXIgSmFrb2JzLCBCZXJnaXNjaCBHbGFkYmFjaA0KDQo= --------------0se6JzriUk02p40Mt2blLQQn Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Am 21.11.24 um 21:42 schrieb Benjamin Patrick:
I am using PGAdmin 4.8.8.=C2=A0 New to the group and hoping this = the correct group for assistance.
My instance is an AWS instance so there isn't a viable superuser.
I had a user create table with the table owner being themself.=C2= =A0 user.schema.tablename
I wanted to change the owner to the dbowner, but was unable in pgadmin or script. dbowner.schema.tablename
I had the user run a script to the change the table owner to the dbowner but the user received an error unable to set role.=C2=A0 = This occurred both in script and pgadmin.

The table owner was able to change to a mutual role that both the user and the dbowner are members.=C2=A0 From there the dbowne= r was still unable to change the table owner to the dbowner.

Any assistance would be super helpful.


Actually, PGAdmin problems should be discussed on the mailing list of PGAdmin.


But since the question isn't related to PGAdmin, but rather PostgreSQL server, I can give an answer here.


Some hints:

  • Include the server version, at least the major version. Current is 17.1.
  • Include the commands you have tried. Don't type them, copy them!
  • Include all messages you get from the server.
  • If something doesn't work in PGAdmin, always try again using psql, because this is the only frontend maintained by the PostgreSQL developers.

It's not possible to change ownership of an object (table, view, schema, function, ...) to a role you aren't a member of. Otherwise, you might change it and lock yourself out.


And of course, you have to be owner of an object to alter it. Unless you are a superuser.


Kind Regards,


Holger


--

Holger Jakobs, Bergisch Gladbach

--------------0se6JzriUk02p40Mt2blLQQn-- --------------koErM8nUXdii5DK0IkT4D4z9-- --------------oRkcalH11JJxgK6iZ8k80rql Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCZz+d+gUDAAAAAAAKCRCKV5yTsxlhuu68 AKDkAzzltaJXBj1WpaBvAHLArwi3iACfZAbhrSytzEC1kJ9HaZeFDMAY5Vo= =PFqD -----END PGP SIGNATURE----- --------------oRkcalH11JJxgK6iZ8k80rql--