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 1qb5a7-00B6D9-IY for pgsql-general@arkaria.postgresql.org; Tue, 29 Aug 2023 20:45:00 +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 1qb5a6-00B6RK-FQ for pgsql-general@arkaria.postgresql.org; Tue, 29 Aug 2023 20:44:58 +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 1qb5a5-00B6Qc-4K for pgsql-general@lists.postgresql.org; Tue, 29 Aug 2023 20:44:57 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qb5a1-001f8y-AV for pgsql-general@lists.postgresql.org; Tue, 29 Aug 2023 20:44:55 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 3B9DE320084E; Tue, 29 Aug 2023 16:44:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 29 Aug 2023 16:44:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mtneva.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693341890; x=1693428290; bh=QJIGVYqrde8Y/Eg2w6pvzAMfvGIO33ewen5 jggg6rps=; b=G/Fglq9Jm9wiBAeHY3ZanL7XibnSycWtIpQGerx5q8cEl8jpn70 zfEH9qNh0+XRvYOZH8e+B5/Eif47rU0JSbZ7CMCFy5tMsOZ5MgRivfsu7xKr4s3o NsaGHfuRW4aptLrwZ4ws0frIvmZlcNnt8xd3Y6y2f1PVSswnoI8m/jn+S/iCmTGe rVRRNYgdLk9nU7rgMyWyEotCc3jjLllmvFUdT4sBVkPwm88KeliJxUYXvd09wwk4 sf+xhxnNebnc83yixUCrVmxPU5PwKzUlaErxmBxGJ0N7WjlwOMoMlerHwM5DcpTa 5p0FlWn9teTCbiHzKBxUCH9NqL593bU+A/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693341890; x=1693428290; bh=QJIGVYqrde8Y/Eg2w6pvzAMfvGIO33ewen5 jggg6rps=; b=MeZ+Eti0FrdvbSK9vI9dvVN4R2emPUstCjL0CdFQ8Dkaf06q42R QoU6yVWd59A716JM8RvdozDAB7wuHWd/JmPFvChQeRSDOfll+go1wz+chS0Ri7Ia 800CLnPk2h6xFVm4EFlI+MMKK+AvDmfnbjlSdYoeae1MsENkUtJE89AQRRxpMWZd zBgknIre5xtHBnmr2kzf1QZzonb4/rO/tBbLmCT7Abs8EbPrJhhjWXibfcVyp4Yz jFPDWlt8QbnoIOHfder8Uh5+TJDZ/KNtTjr0CI08/8/ppJM6ST4H6Jgnw2wWCQV+ cot+HR146pGAnlkukqnbKFZwynDTIw1TBTQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefiedgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepufht uhgrrhhtucfotgfirhgrficuoehsmhgtghegudeludesmhhtnhgvvhgrrdgtohhmqeenuc ggtffrrghtthgvrhhnpeelgfejveehueelvdeglefgvdfgtdfgtdeuheduffekteffveek tdethefgueejkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsmhgtghegudeludesmhhtnhgvvhgrrdgtohhm X-ME-Proxy: Feedback-ID: i4271461c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Aug 2023 16:44:50 -0400 (EDT) Received: from [10.1.65.222] (fuji.home [10.1.65.222]) by fuji.home (Postfix) with ESMTP id 5A3463A114A; Tue, 29 Aug 2023 14:44:48 -0600 (MDT) Message-ID: Date: Tue, 29 Aug 2023 14:44:48 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Restoring default privileges on objects Content-Language: en-US To: pgsql-general@lists.postgresql.org Cc: Erik Wienhold , Tom Lane References: <96d6885a-5e25-9ae8-4a1a-d7e557a5fe9c@mtneva.com> <1166048641.281962.1693308151542@office.mailbox.org> <1006397.1693318485@sss.pgh.pa.us> <1550267563.330669.1693335893138@office.mailbox.org> <31246.1693337238@sss.pgh.pa.us> From: Stuart McGraw In-Reply-To: <31246.1693337238@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/29/23 13:27, Tom Lane wrote: > Erik Wienhold writes: >> On 29/08/2023 18:43 CEST Stuart McGraw wrote: >>> Shouldn't psql put *something* (like "(default)" or "-") in the >>> "Access privileges" column to indicate that? Or conversely, >>> something (like "(none)"?) in the revoked case? > >> Indeed, that's confusing. Command \dp always prints null as empty string [1]. >> So \pset null '(null)' has no effect. > > Yeah, perhaps. The reason it so seldom comes up is that a state of > zero privileges is extremely rare (because it's useless in practice). > > That being the case, if we were to do something about this, I'd vote > for changing the display of zero-privileges to "(none)" or something > along that line, rather than changing the display of NULL, which > people are accustomed to. > > Fixing \dp to honor "\pset null" for this might be a reasonable > thing to do too. I'm actually a bit surprised that that doesn't > work already. > > regards, tom lane That change would still require someone using \dp to realize that the "Access privileges" value could be either '' or NULL (I guess that could be pointed out more obviously in the psql doc), and then do a '\pset null' before doing \dp? That seems a little inconvenient. As a possible alternative, in the query that \dp sends, what about replacing the line: select ..., pg_catalog.array_to_string(c.relacl, E'\n') as "Access privileges" ... with something like: CASE array_length(c.relacl,1) WHEN 0 THEN '(none)' ELSE pg_catalog.array_to_string(c.relacl, E'\n') END as "Access privileges" I realize that removes the ability to control with pset what is displayed, but maybe a little more foolproof for naive users like myself?