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 1o8MY8-0007tt-S9 for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jul 2022 13:55:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8MY7-0000ev-MO for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jul 2022 13:55:39 +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 1o8MY7-0000el-D4 for pgsql-hackers@lists.postgresql.org; Mon, 04 Jul 2022 13:55:39 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8MY3-00075B-SX for pgsql-hackers@postgresql.org; Mon, 04 Jul 2022 13:55:38 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8AB245C009C; Mon, 4 Jul 2022 09:55:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 04 Jul 2022 09:55:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm2; t=1656942933; x= 1657029333; bh=XgiGdaZEMJocIDMolzcdPpxe2cqOUG6g/nhoqOeS4m8=; b=L jF69/0QbKpkJzi+lVHIllMatFupBM4QD7Mk7oywTDO/Sby4TIZL5VT8mBYr5cbo+ UJ3KnZx/+eypWnH8QXibeL/ET561pU+uufCSEVFaMwxM+YH9vSHeTQWPJXMvspsX nBDHM+6JPz7vLSlYrqLLXLqM8VBzIBspBIV6LihNMavoUe/j73FbquF6/0Zo9481 g7a0dU4NYS5VvB86/WvrzfdQ/536DiEWm/cEqMxYgipwV6yyQ2UvYyQHX8aXbrl7 hyRaQWS9e48SY/IFMSjH8yipp6UDNChFdMaUo7189PJkqSMVCIAZ4br5endRq2+o 98YixRqdAcj9Fn7wPavTg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudehledgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfevjggtgfesth ejredttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomheqnecuggftrf grthhtvghrnhepgfehgedvfeekgeeikeejtdejtdeiieekgeevtefhgfffvefhheeuieev tdfghffhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epphgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Jul 2022 09:55:32 -0400 (EDT) Message-ID: Date: Mon, 4 Jul 2022 15:55:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: pgsql: Change timeline field of IDENTIFY_SYSTEM to int8 Content-Language: en-US To: Tom Lane References: <1467434.1656914113@sss.pgh.pa.us> From: Peter Eisentraut Cc: pgsql-hackers In-Reply-To: <1467434.1656914113@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 04.07.22 07:55, Tom Lane wrote: > Peter Eisentraut writes: >> Change timeline field of IDENTIFY_SYSTEM to int8 > > Surely this patch is far from complete? > > To start with, just a few lines down in IdentifySystem() the column > is filled using Int32GetDatum not Int64GetDatum. I will get some > popcorn and await the opinions of the 32-bit buildfarm animals. > > But what about whatever code is reading the output? And what if > that code isn't v16? I can't believe that we can make a wire > protocol change as summarily as this. I think a client will either just read the string value and convert it to some numeric type without checking what type was actually sent, or if the client API is type-aware and automatically converts to a native type of some sort, then it will probably already support 64-bit ints. Do you see some problem scenario? I'm seeing a bigger problem now, which is that our client code doesn't parse bigger-than-int32 timeline IDs correctly. libpqwalreceiver uses pg_strtoint32(), which will error on overflow. pg_basebackup uses atoi(), so it will just truncate the value, except for READ_REPLICATION_SLOT, where it uses atol(), so it will do the wrong thing on Windows only. There is clearly very little use for such near-overflow timeline IDs in practice. But it still seems pretty inconsistent.