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 1seC55-004nxd-BH for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Aug 2024 11:22:19 +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 1seC52-009fS9-KV for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Aug 2024 11:22:16 +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 1seC50-009fRm-Lw for pgsql-hackers@lists.postgresql.org; Wed, 14 Aug 2024 11:22:16 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seC4x-004h0j-Gg for pgsql-hackers@lists.postgresql.org; Wed, 14 Aug 2024 11:22:13 +0000 Received: from phl-compute-07.internal (phl-compute-07.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 9B85A1150943 for ; Wed, 14 Aug 2024 07:22:09 -0400 (EDT) Received: from wimap21 ([10.202.2.81]) by phl-compute-07.internal (MEProxy); Wed, 14 Aug 2024 07:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= 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:subject:subject:to:to; s=fm3; t=1723634529; x=1723720929; bh=+YXuqs3UkkT1JyfrFsOyS4cmn7nae+GiIfOgBA4uDVI=; b= O+mO58xiyrzHoz8e8e7xWAaw935igNoprT2bk0C8VQ/RlpPxHnevTutiNvKBDi3y 6jB2EtA3ks4c4c0QtEiNPEHSbZAmwifjnGjVSeRKk1oHjcoy9d5q6bM0OIMcMN1Y 75LOT6aeG9Iz8QoMhX2QmIpk1wns29m8KLisP2koX5Lott2xafUoxFVbKyo8I0IS DxHmZvHxNixTncCCIxeo6PUTmYBABRmGAB/h40EQwGyjXeUi26tXSdeQifB884B8 5iZJyXHkHun7ijo8+493mttwZ79790vx35LNhGWcpw10izrmrphJ+TbT9OcYLTNG LJNVaU7IgTJOJBuSYIqM4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723634529; x= 1723720929; bh=+YXuqs3UkkT1JyfrFsOyS4cmn7nae+GiIfOgBA4uDVI=; b=N Q+Txq7mJjr8b8KSKBdHwffeaf/xvJXFqLJFQSt+ab6BADgJ5gFV5aAA4IFZfKS7q WpXDPE/irAL9DSuvgdtsIIw61Be3CpyJ3lSKXAqdyDg7O9eN+IO80rF6vBOmVexe nXzfueqPwQ/A7b3AFD1az5zI/vUojdvUu4LVQRf8K+lAYsJ74pRtpFhSf0eZgupJ b8nhZI/oD9041P5Du3FeGkczfDRHjKPi6XMTVbckk2kmmhe/P8U57RX5aKjtj2rS VtqYsoiaXVlzDFfSTmcEUbJgqWY6ZfOuWQmWKuO4Oj/xKIypV0VkDtSoSkjZ55Rh 4BGsMh0Riqq6FuS7QsHUg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddtgedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefoggffhf fvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedflfhovghlucflrggtohgsshho nhdfuceojhhovghlsegtohhmphhilhgvrhdrohhrgheqnecuggftrfgrthhtvghrnhepve elffdtiedugfdvgffftddvieevleetieetgfettdffjedtjeefffelhfelffeinecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhovghlsegtoh hmphhilhgvrhdrohhrghdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvg hsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ic6394509:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4EC8837A0085; Wed, 14 Aug 2024 07:22:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Wed, 14 Aug 2024 13:21:49 +0200 From: "Joel Jacobson" To: pgsql-hackers@lists.postgresql.org Message-Id: <7882ebcf-4f1f-4f57-afeb-e1301dd6c9d3@app.fastmail.com> In-Reply-To: References: Subject: Re: [PATCH] Add get_bytes() and set_bytes() functions Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 14, 2024, at 13:01, Aleksander Alekseev wrote: > The proposed patch adds get_bytes() and set_bytes() functions. The > semantics is similar to get_byte() and set_byte() we already have but > the functions operate with bigints rather than bytes and the user can > specify the size of the integer. This allows working with int2s, > int4s, int8s or even int5s if needed. +1 I wanted this myself many times. I wonder if get_bytes() and set_bytes() will behave differently on little-endian vs big-endian systems? If so, then I think it would be nice to enforce a consistent byte order (e.g., big-endian), to ensure consistent behavior across platforms. Regards, Joel