Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeCKe-0007Ab-UR for pgsql-general@arkaria.postgresql.org; Thu, 28 May 2020 06:48:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jeCKd-0003id-NH for pgsql-general@arkaria.postgresql.org; Thu, 28 May 2020 06:47:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeCKd-0003iU-8e for pgsql-general@lists.postgresql.org; Thu, 28 May 2020 06:47:59 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jeCKa-0005vx-Gv for pgsql-general@lists.postgresql.org; Thu, 28 May 2020 06:47:58 +0000 Received: by mail-ed1-x541.google.com with SMTP id bs4so22276659edb.6 for ; Wed, 27 May 2020 23:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=CMYyTWzwcxpWkzyQSJcXOZqjLS4e9SHZFbytiAldbpE=; b=XYXFUzqlW00Zb+Fu367PzKj1ndnF8/zP2qEZ7aroH5dr6Ty+6+CuBxgKeyh1FLDHIz vnexzgvIZINaa7rGlfNJpBFCsF5sxaMjtqv5G3WRgS1RFF8ZoDXxZ7S3JWnQKCZ7QlO2 +g0MrJROMK6xT94X7LFzlj05HZ5zvQEvdMsvYeKwnazFm3Y/GnENO1AzgnU+NzRK3/jR wA3otTYgZiFdal4jk86rrHKU1eaiiN4vlV46DxojRwPlnbtViYMIAzlQ7mP1GjJ/YXJJ 32x5djuJnQSW1P2OXO5kQjfQYc5AmnhVZnbK5+10qde02L5KexyE/zC+/DexdqCL0CCG 9TjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=CMYyTWzwcxpWkzyQSJcXOZqjLS4e9SHZFbytiAldbpE=; b=ncHB1FAA3FQb85bWht/Zy67rFtEruG8uBet+hC/nBjq+QJCk20lXjPIvXog37H7T6y g95B5ubJqUblD0qjRbEq983SmBZfqwspMaM2c3Lt/TCfXv4EmP0mlYnJaqrMTP9E6KIu nb8xvJ0a+sHBOz5odg/fW87NHCH7v531sgHOBMGbi4sJfH5dIoSGbazo2/WkodVTF3Sp EqJr6o/DBaBjl4vY+s8Cll0lpjxKZcjFExHuUaM/fB0IHkTu0kxFnv0d8LZhq5LW3saK 78IQTlHNWEXkift1LFtDO2W4gwC/o5dssgGssKAGtCszKn6Nlg/PTfTyIdV7zFWjp+u0 yl5A== X-Gm-Message-State: AOAM530xoGma/aR2SyotXg1fV9FQPoZIKVy1nGiH2PiN8hqUxWHZczRn 2XKxBJZgzaQuKO3N3VE9gNfWzw== X-Google-Smtp-Source: ABdhPJx7ef7OpnFnIrGP3PcTVAyFKxJRTIaNHvKkZZ35CPawbrueV7d9BURGQ7YIz7+n84MwJfTrJg== X-Received: by 2002:a50:f40d:: with SMTP id r13mr1492391edm.93.1590648474736; Wed, 27 May 2020 23:47:54 -0700 (PDT) Received: from localhost.localdomain (217-149-172-72.nat.highway.telekom.at. [217.149.172.72]) by smtp.gmail.com with ESMTPSA id w21sm3848451ejc.11.2020.05.27.23.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 23:47:54 -0700 (PDT) Message-ID: <0087809ce65d648b1394b1a21b920ac2b4ea7f88.camel@cybertec.at> Subject: Re: Can't remove default permissions entry From: Laurenz Albe To: Christophe Pettus , PostgreSQL General Date: Thu, 28 May 2020 08:47:53 +0200 In-Reply-To: <4BCE1557-F145-46C9-9410-C67CA7510105@thebuild.com> References: <4BCE1557-F145-46C9-9410-C67CA7510105@thebuild.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2020-05-27 at 10:06 -0700, Christophe Pettus wrote: > On RDS (thus, no superuser) we are trying to drop a user. The only remaining item that the user owns is an "empty" default permissions entry, but we can't seem to get rid of it so that the user can > be dropped: > > I'm sure I'm missing something obvious! > > Logged in as xyuser: > > db=> \ddp+ > Default access privileges > Owner | Schema | Type | Access privileges > ------------+---------------+----------+-------------------------- > xyuser | | table | > > db=> ALTER DEFAULT PRIVILEGES FOR USER xyuser REVOKE ALL ON TABLES FROM xyuser; > ALTER DEFAULT PRIVILEGES > db=> \ddp+ > Default access privileges > Owner | Schema | Type | Access privileges > ------------+---------------+----------+-------------------------- > xyuser | | table | That's tricky one. The answer must be that the empty entry is *not* a NULL (meaning default privileges), but actually an empty entry, meaning nobody gets any privileges, including the table owner. The solution is to restore the default situation: ALTER DEFAULT PRIVILEGES FOR ROLE xyuser GRANT ALL ON TABLES TO xyuser; Then the offending entry should be gone. It's probably too late to fix that, but in my opinion it was a BAD design decision to use NULL to represent default privileges, at least on display. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com