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 1pMv2a-0005bJ-7U for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jan 2023 18:07:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pMv2Y-00012N-HY for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jan 2023 18:07:30 +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 1pMv2X-00010v-5k for pgsql-hackers@lists.postgresql.org; Tue, 31 Jan 2023 18:07:30 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMv2N-0001Sr-AA for pgsql-hackers@postgresql.org; Tue, 31 Jan 2023 18:07:28 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 068A85C0074; Tue, 31 Jan 2023 13:07:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 31 Jan 2023 13:07:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc: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=1675188436; x=1675274836; bh=eUUfSt1cAl 7KrbknOkDcLsVvIRLKgosCOHBra1NOAM8=; b=ta3jN3+WxMsOBsqk0a8qAgwlmq 1ID0VgEC2lLyfuuf9xYoAfoycm1uSBUDTgfe2i3lJ3TipHdyQezrZ8EtMDJ1fOEa ONNZzsxJTSZB527Dhy0jrFSCKwuHTs0dFeo5DgmLboCdC8gcP+g1lHs75femmvP/ nEnxMxUicjyv3ndd1r7LfEJXMqLD/Dn0eMetibk1IsO2XyavFG0mD+e4Br31oBj8 BH5Ibcx8BP8/5APbB78gr2u7bh8sJ58H4CldPD43q/SlAOvkQ0HzrT4l/XlgbiNC uZH/bO8jGB/AHiR+TWkV+CqazVk4R3zrhA8QR+L/aAquEoRko8uri8aszQ9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm3; t=1675188436; x=1675274836; bh=eUUfSt1cAl7KrbknOkDcLsVvIRLK gosCOHBra1NOAM8=; b=Y8BD5OL4WEJkr3fUhHuq1ZbLgh1P8APE0pxXPIenwAOX fnYL/ueFB0Hr540NhWJ2Mi+j2BCAr9lmYf1PUN7uT4GgdMQgoGIprHqfy/2OW0KW QnzKYZvFL8mDi0pDHmeKtbEeIu0UjPdMc5WoS5CILtVj8f8cKYZKkyx60xR5dvQz wi8kHUkBCkASQffG6wmsS6eTMAwErZsRXOVIKv01K4LB7Upmdthkna0u56ODaoT9 eNTPEBCsT7f1VzmCF/082Vpo1ZQ25NxZyPG17TvwBlJO8B5daFczUHnJ3vWO6Lh7 MawynTZCP77r0uMI8VY+io2z0FbRZ4GzZCDueieHBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudefgedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufhffjgfkfgggtgesmh dtreertderjeenucfhrhhomhepffgrghhfihhnnhcukfhlmhgrrhhiucforghnnhhsnohk vghruceoihhlmhgrrhhisehilhhmrghrihdrohhrgheqnecuggftrfgrthhtvghrnhepvd dvhfehtdefkedugfetudefhefggfegjeeijeehuefgteehgfegtdelgeetteejnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhlmhgrrhhise hilhhmrghrihdrohhrgh X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 Jan 2023 13:07:16 -0500 (EST) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: Clarify deleting comments and security labels in synopsis References: <87sffqk4zp.fsf@wibble.ilmari.org> <1139370.1675186526@sss.pgh.pa.us> Date: Tue, 31 Jan 2023 18:07:15 +0000 In-Reply-To: <1139370.1675186526@sss.pgh.pa.us> (Tom Lane's message of "Tue, 31 Jan 2023 12:35:26 -0500") Message-ID: <87pmauk27g.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Tom Lane writes: > =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: >> A user on IRC was confused about how to delete a security label using >> the `SECURITY LABLEL ON … IS …` command, and looking at the docs I can >> see why. > >> The synopsis just says `IS 'label'`, which implies that it can only be a >> string. It's not until you read the description for `label` that you >> see "or `NULL` to drop the security label." I propose making the >> synopsis say `IS { 'label' | NULL }` to make it clear that it can be >> NULL as well. The same applies to `COMMENT ON … IS …`, which I've also >> changed similarly in the attached. > > Agreed; as-is, the syntax summary is not just confusing but outright > wrong. > > I think we could go further and split the entry under Parameters > to match: > > 'text' > The new comment (must be a simple string literal, > not an expression). > > NULL > Write NULL to drop the comment. Makes sense. Something like the attached v2? > regards, tom lane - ilmari --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Clarify-that-COMMENT-and-SECURITY-LABEL-can-be-se.patch From 0fb27fc8a5f484b87df6068076987719f0fb79bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Tue, 31 Jan 2023 16:05:20 +0000 Subject: [PATCH v2] Clarify that COMMENT and SECURITY LABEL can be set to NULL in the synopses This was only mentioned in the description of the text/label, which are marked as being in quotes in the synopsis, which can cause confusion (as witnessed on IRC). Also separate the literal and NULL case in the parameter list, per suggestion from Tom Lane. --- doc/src/sgml/ref/comment.sgml | 16 ++++++++++++---- doc/src/sgml/ref/security_label.sgml | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7499da1d62..470a6d0b5c 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -66,7 +66,7 @@ TRIGGER trigger_name ON table_name | TYPE object_name | VIEW object_name -} IS 'text' +} IS { 'text' | NULL } where aggregate_signature is: @@ -263,11 +263,19 @@ - text + 'text' - The new comment, written as a string literal; or NULL - to drop the comment. + The new comment, written as a string literal. + + + + + + NULL + + + Write NULL to drop the comment. diff --git a/doc/src/sgml/ref/security_label.sgml b/doc/src/sgml/ref/security_label.sgml index 20a839ff0c..e4eee77932 100644 --- a/doc/src/sgml/ref/security_label.sgml +++ b/doc/src/sgml/ref/security_label.sgml @@ -44,7 +44,7 @@ TABLESPACE object_name | TYPE object_name | VIEW object_name -} IS 'label' +} IS { 'label' | NULL } where aggregate_signature is: @@ -178,11 +178,19 @@ - label + 'label' - The new security label, written as a string literal; or NULL - to drop the security label. + The new security label, written as a string literal. + + + + + + NULL> + + + Write NULL to drop the security label. -- 2.34.1 --=-=-=--