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 1nM1NO-0007c3-5u for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Feb 2022 05:36:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nM1NN-0000Xv-1o for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Feb 2022 05:36:45 +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 1nM1NM-0000Xd-5j for pgsql-hackers@lists.postgresql.org; Mon, 21 Feb 2022 05:36:44 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nM1NJ-0003X3-HS for pgsql-hackers@lists.postgresql.org; Mon, 21 Feb 2022 05:36:43 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3370E3201DBF; Mon, 21 Feb 2022 00:36:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 21 Feb 2022 00:36:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; bh=+ oP7824jJrz4/95dckkr2Hcl6DPvVUI9+hdlVlSYKRo=; b=PXfQ3d+QNETlHOgj/ aqLhrkif3BpTBWI4yH3CjKnlpHFM1Iy62NxiSKbM+kWt5JytxDNnwDvdFicnJ5Bp NG9Ai529z7sbhkkzuz4GnwiCjR2pkuhK5y0SC3H9EJ4gEcgXI/30UtzeguZIx1V9 sSO4AaQB0GYSGXOKmbHTcVOJaKYVjM+FWsQpC/3YTuNV5X4DaCN7dZCJtSyNoKIU Adg88ZFeJ8W1dwxM50NcteuXJIc78cjdSUdLceZZbi5y31Ow9eAQOioyN2w9vS89 4DmJy5gyHf6p2r8pbDbjuQ7f28TRBjKnzNLfit0H9Q8NB72GEpemlumnJJOyp6vi q8RVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=+oP7824jJrz4/95dckkr2Hcl6DPvVUI9+hdlVlSYK Ro=; b=JPUe6TFOZAldFuyNOK5ICjYDZ4U/teRCsAzeIoUJPyu8AW+mhnHqTxE8b ML/T27dlH8JGGNdq2bHF/PSB8dMtlIgoB8+QOANkkwzuqFWg7kav1xaaS0hGXNKh XEPd7x+GZyJ7wO+4rTt1RIgRsApa0Q5K+aNh7isMJaz5m99svtsLfhzEqjNSrirn 3wUxq9jMiKnQOmYaQ9Y9Ujf7d7R7qVvpCbPUYb1NzrnU5YSvUVG9yv8Vc3V44Rxq tjQRmV6+IZXfxLHsyKs3KvHDcVUIsZX4OJx6emc+UNpHHShhSuIUybRlsi2KdlZU 9QCSA72xVfsa9r4QhE7SXvyx2VQLQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeehgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfggtggusehgtderredttddvnecu hfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuih gvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvddtffetgedthfeugfevvddtjefguefg gefgjefgvdehgfefveeikedtleekhffgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Feb 2022 00:36:37 -0500 (EST) Date: Mon, 21 Feb 2022 14:36:33 +0900 From: Michael Paquier To: Postgres hackers Cc: Amit Kapila , Masahiko Sawada Subject: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="u61RLKbMaOh8LfXW" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --u61RLKbMaOh8LfXW Content-Type: multipart/mixed; boundary="J/aiLp8B5BwpSncl" Content-Disposition: inline --J/aiLp8B5BwpSncl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, (Author and committer added in CC.) While reviewing the code of a bunch of SRF functions in the core code, I have noticed that the two functions mentioned in $subject are marked as proretset but both functions don't return a set of tuples, just one record for the object given in input. It is also worth noting that prorows is set to 1. This looks like a copy-pasto error that has spread around. The error on pg_stat_get_subscription_worker is recent as of 8d74fc9, and the one on pg_stat_get_replication_slot has been introduced in 3fa17d3, meaning that REL_14_STABLE got it wrong for the second part. I am aware about the discussions on the parent view for the first case and its design issues, but it does not change the fact that we'd better address the second case on HEAD IMO. Thoughts? -- Michael --J/aiLp8B5BwpSncl Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="proc-proretset.patch" diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 7f1ee97f55..aa05b9665f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5370,16 +5370,16 @@ proargnames => '{pid,status,receive_start_lsn,receive_start_tli,written_lsn,flushed_lsn,received_tli,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time,slot_name,sender_host,sender_port,conninfo}', prosrc => 'pg_stat_get_wal_receiver' }, { oid => '6169', descr => 'statistics: information about replication slot', - proname => 'pg_stat_get_replication_slot', prorows => '1', proisstrict => 'f', - proretset => 't', provolatile => 's', proparallel => 'r', + proname => 'pg_stat_get_replication_slot', proisstrict => 'f', + provolatile => 's', proparallel => 'r', prorettype => 'record', proargtypes => 'text', proallargtypes => '{text,text,int8,int8,int8,int8,int8,int8,int8,int8,timestamptz}', proargmodes => '{i,o,o,o,o,o,o,o,o,o,o}', proargnames => '{slot_name,slot_name,spill_txns,spill_count,spill_bytes,stream_txns,stream_count,stream_bytes,total_txns,total_bytes,stats_reset}', prosrc => 'pg_stat_get_replication_slot' }, { oid => '8523', descr => 'statistics: information about subscription worker', - proname => 'pg_stat_get_subscription_worker', prorows => '1', proisstrict => 'f', - proretset => 't', provolatile => 's', proparallel => 'r', + proname => 'pg_stat_get_subscription_worker', proisstrict => 'f', + provolatile => 's', proparallel => 'r', prorettype => 'record', proargtypes => 'oid oid', proallargtypes => '{oid,oid,oid,oid,oid,text,xid,int8,text,timestamptz}', proargmodes => '{i,i,o,o,o,o,o,o,o,o}', --J/aiLp8B5BwpSncl-- --u61RLKbMaOh8LfXW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmITJOEACgkQnvQgOdby QH2AlRAAg6A9VynPb7DyOaQ604uLE4hI9RkoJrv+qDwmGKF0k85PLKhrghEiK+GF HNFhKic9s8zyj6RyvLL0jg2xd/+BAVdcW9QdTm78FQav1MdQ/7gp6wpa/VL+CyKH 3SXuV4cpr33Cc/23l8bYJOR9/QqPBiZBOHQmAsECMdwE5BmvEjPYtMyB0cPwZXcm v+IeeVxIGW5bWR8tKUA6RqMXgJusKfxqiPsLcob8OPQE6XwdZosX3G2vOg7tMwar A2TOZO/RbpopPgxJQfZ9byJNDwPDj3eXk+SQfkanrtrGSvE797nqMa0sRl3Y9O/s qRJQ14HCarvVR9fgGk9kpx33nXuV5cnAs4jhNi54RNTt9xa0sf9H5mybRRCDfum8 hP6YxH3lpaGcqczE79EfhXXcBd8MPYNwF76DDsHUkgHbwD8ktroA1u3zc0lb+2q8 0yEjzNlhCUYbsj0Mm6ztJXq2NvW6QXbHuDSkZkLvExqW3gn3dSnBVCYb3ysSPwxS uRP1Bo+pNHoS5NRrh6+Qfc8d3Hp11jh+HUJ2rysZx5MOESdyr56ZGQkVnTiNPuTh FA4gWDkdRGJZegL4zuYGb80bKhlv73RkXCGIyU/ZdMOEDUZdFPW8gjRE8HO5PSmb 5GzpO0n543YtcVuPc9dfqDQLhdKLmsJNX1/99AxOLbE8KrAnbKI= =x51a -----END PGP SIGNATURE----- --u61RLKbMaOh8LfXW--