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 1tVLro-007Wvg-Jx for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 02:32:21 +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 1tVLro-00BMy9-3v for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 02:32:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVLrn-00BMy0-Bg for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 02:32:19 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVLrj-000Rzf-21 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 02:32:18 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 6ABF71140158; Tue, 7 Jan 2025 21:32:13 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 07 Jan 2025 21:32:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1736303533; x=1736389933; bh=2SFs8L5o7n PjtjqFr9tR4eszIJCbgVElcXnBVVrH0aY=; b=KVoIV4xpBHYxceAJllc8VIvpdC bq+lIqHp/HYaRGNdOHqR07cN4pBmQedpropI+arSEUzsXF5DyfQLWul41m0KGJpx 8nLKRIruVOaC3bqVZ+jY5fykijj/GBHQPnc92Y+gNi+AVRQIs2uA3FpmwxYAqyw/ BdiHoIOAHlyxG77JGkhwhwHZWN7ruqFJWv8lluYNROKNLWL7DKB3jyjT3BLPCU8e t8yB1qMwvYNfMM3/BBbzjs50IPJdTyjeHY1wd+U1PYe9Y4qMhR+A1Loo2K2t6l17 fVDqhQjZHK+JhPgz6VbEezNHGnuqcox6sHuSRooUrAwUj8/pDDM4dLtyw3ZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1736303533; x=1736389933; bh=2SFs8L5o7nPjtjqFr9tR4eszIJCbgVElcXn BVVrH0aY=; b=NtCNGEvXTy0t3ODxClvluTd7Qm3BmG9DhI5/7u5IgsxJwDDv5an noh49bFmltWw1SJnIozRMZrIWmfuzw6O1FosoN9kYfaPlRgguCbXmSfqz7y5Exci kxHNgxeQDsmeTLwaq6XciLIRPO9Q+WjOtSyYvrlq5wl7kvNYwA4iXUeV6S8Ssv+n L0rRRMP1fD4+WAFOWgBnAleC1pbZKL5Bs+hDp42tzDtgSSw4sdWgXRCk4SOSzNsj 8BRNkP5sB7QTBqwUQABEbMI52eow9ivz5KymSEEc269SpCpqvB8oD6vhYqwbFcMG VBfBDsB8CRRKxNBJOfOur9a3G947gUdqaXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegfedggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteet gedvvdevueeiudduveekffevvedtudelheellefftddvgeefgedtjeettdeknecuffhomh grihhnpehpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtg hpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepnhhorghhsehlvggr uggsohgrthdrtghomhdprhgtphhtthhopehrohhnrghnrdguuhhnkhhlrghusegrihhvvg hnrdhiohdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhspdhrtghpthht ohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorh hgpdhrtghpthhtohepphgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhs vggusgdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jan 2025 21:32:10 -0500 (EST) Date: Wed, 8 Jan 2025 11:32:00 +0900 From: Michael Paquier To: Noah Misch Cc: Ronan Dunklau , Tom Lane , pgsql-hackers@lists.postgresql.org, Peter Eisentraut Subject: Re: Converting contrib SQL functions to new style Message-ID: References: <3395418.1618352794@sss.pgh.pa.us> <3133933.1730855116@sss.pgh.pa.us> <5829980.DvuYhMxLoT@aivenlaptop> <20250106190428.ec.nmisch@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bc8TuMW5s8JzDV+S" Content-Disposition: inline In-Reply-To: <20250106190428.ec.nmisch@google.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --bc8TuMW5s8JzDV+S Content-Type: multipart/mixed; boundary="DrznTxUPd9gsfIWB" Content-Disposition: inline --DrznTxUPd9gsfIWB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 06, 2025 at 11:04:28AM -0800, Noah Misch wrote: > Per postgr.es/m/3489827.1618411777@sss.pgh.pa.us and > postgr.es/m/1471865.1734212070@sss.pgh.pa.us one requirement for migrating to > SQL-standard function bodies is removing these inexact-match function and > operator calls. Here, one could either write pg_catalog.generate_series or > make the argument types match exactly. Thanks for the report. Tom has used casts for xml2 in 667368fd26de, and also combined some pg_catalog for schema qualifications in citext for example. In this case forcing the data types seems more elegant to me. What do you think about the attached? -- Michael --DrznTxUPd9gsfIWB Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="freespace-bug.patch" diff --git a/contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql b/contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql index 7f92c9e92e3..a75c4d8642b 100644 --- a/contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql +++ b/contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql @@ -9,5 +9,5 @@ RETURNS SETOF RECORD LANGUAGE SQL PARALLEL SAFE BEGIN ATOMIC SELECT blkno, pg_freespace($1, blkno) AS avail - FROM generate_series(0, pg_relation_size($1) / current_setting('block_size')::bigint - 1) AS blkno; + FROM generate_series(0::bigint, pg_relation_size($1) / current_setting('block_size'::text)::bigint - 1::bigint) AS blkno; END; --DrznTxUPd9gsfIWB-- --bc8TuMW5s8JzDV+S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmd946AACgkQnvQgOdby QH36UhAAp/Dlnn7uUZqeNGWHSckbuVwO40xHyAvNQ2z63aa6wm300KUR7RLoihmw dQMao7FwAV4rD0x9NvpZ6b1TyGQB+Xje0gPDca7G8XdkLdzcklP3LcL37ucHvB8Z lQkRGtJys/JhBafuzLyEclq+GN9pHUE58+B+4x15Ce1DIaH0l231ZaZQ/7nVW2l4 RtGFqyf+TLvS/D+UWQgco1ckti7F7JUwgIY4k9U1NbPGFAMt3Ic7heKCEQ8czPOD 1ycW9yp4E2t7AIRuQb7rLRFERcBNUc+jG0nACJ2gnT5WeSUbUMhGOj4bJKfVGLIX B3dQAyUcEI0NVJxAglmDesKZHuXnO0FR9yMUHxRldXqllFl8kGpe1zNjgQYFeLOV bx6PbuA+ReR5xAQG3XV4pKjJJ1TuC6310QOWHaOD8qdmsVABX0WTk6GdiwLChiID gufIagcybbAehdg7qGyxqGXA3iK+y7fYKn7oAXKNnxeCxmQLhn5pwGv1gSjzNaoD EHkEwf0ZVQt9qXoxhOpX/T2zpNTjBfHTZaAnjsA/5XvBdVRQyZjeV25HqMDgPl9a LCpOqfS+ieIJ0fbRxXiVTUV9sl161w0FP/8UGrZh5Y1DejsWCxe65/ayshxjQ0CO +PAL49XOjZrH8I9HCRQht+aN2Nk6FNVennuyPrUUoFSSXOqEdxQ= =lpKf -----END PGP SIGNATURE----- --bc8TuMW5s8JzDV+S--