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.96) (envelope-from ) id 1vd82U-00EJ0q-0s for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Jan 2026 14:28:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vd82S-008Mn8-38 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Jan 2026 14:28:01 +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.96) (envelope-from ) id 1vd82S-008MmA-27 for pgsql-hackers@lists.postgresql.org; Tue, 06 Jan 2026 14:28:01 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vd82S-004XmN-0B for pgsql-hackers@postgresql.org; Tue, 06 Jan 2026 14:28:00 +0000 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4f1ab2ea5c1so12339421cf.3 for ; Tue, 06 Jan 2026 06:27:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767709679; x=1768314479; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VQ78cNx4+pOpl7O/IrKSnTAbao5kmGiis9ZgHnKgzaE=; b=Hgi3qAPjUCKTM9KrLX7S2QhjvTYOAaT3LepOGpIFNmy9FHAzWp/xLdBRrB+LiU4MVo 3EFlykpW/kpdMdF4IXEEE8JAaSPwGyLzj+Cx36kpB7AZ4DLbOhDcEgWQxxMiaN9RwTxV KlxfgJsCgHrYxetw0IM4eANDPfh4uYf37vd00nYaXStk8GqmboxAEW1uP13yIIoJY0TJ AGGnDmR9SyHqrF87EiEsO8Z+Hx4eeOe42gz/DW02xS5SfAWCXrxoRC3+mn9pAnt0JngW LoZsHwyzMDqQQWUv0es1gO/YYW6n1VyX+GcXmfA50cBbIo8w2xc63L+G3Q2bHpu1vYJF KOYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767709679; x=1768314479; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VQ78cNx4+pOpl7O/IrKSnTAbao5kmGiis9ZgHnKgzaE=; b=ZtB+iAelEOzNOCyHQpe8nN3A6Xqn3FUZDHqBUGWGO+jNr7xxIcTsUVBd1Iv4JYl76L ThQKUa7mp/lQi9h18DehQgRXJyKSOhiqQfpavx/vGPlbB2jaAIQnjFn0kc5h/oGuQqWK Jw1vUq3jUL33ewRL6AwC8PRWnA0PhopJZt5ha9LwT4Jrk1uWW3cq1JP1qlZA31FdBIye ogwgoPQIvTy4FxhyQ0uurcWueCu5O365Y1tm6inHTPa5ilhYmiDANb1eGPwF1EF7s1Cd CEZjxqpbEaty1v4bd9nqch/Axm6iJKdBthfHxUFhXt6gdDSDMwRCFoeGliicJhYSt48F LCXA== X-Gm-Message-State: AOJu0YxBuiC176MaJRE55klEc0AaTMJHzzpVBerFgjN+8sULdKRJQXS4 B5AEbJRqMvSkBPGA0/2cPd8mS1I4vZeaELY5qUC5nEW/uYp6GyeqS4uN4za7QETJFoCZcBfcsDl wkFOcS5wX+Im6Zd+r34FB2ZR0uK+KmkI= X-Gm-Gg: AY/fxX44jAPSH1oQSSVMBBsHX1rRIcKij+ZEhLVRN3xERqWSBgfMeHb7gZGpWRY2tb8 QKW8VSRZzg9BDFT4vdiX10oAdZI6cBTILCn/wbM7waxIzZZsDehxFb1j1hlQRCxXZ3M7XnuKffP ZglaRRnz0pB/E631fdUWklnoVZak2d0Qsn1arOSjaGrXGKypMlelyeyQeYaPlb5vzb8AYNBTxVk DmUG/BE0+r8PzctqJOVuzVPQMxOPmZhR1OCgy7ExU7Ux3Kz15YUw9oDScOGEIk6HJAWbRUITsBW cdRMHrF+znU1r+JjslA6UZ1z+fFigQ6o//8s6+gB/TKHNjBuFKYfYqoxTqr76/lWllng4g== X-Google-Smtp-Source: AGHT+IFLMPMCYf8Wv7DN2drCatL8VtugkWZL1xBwzfPFTMjFq8g3n2QASX15m+ExV+61KntSiKgdLg7epWZb2p82WsY= X-Received: by 2002:a05:622a:11c7:b0:4ed:2164:5018 with SMTP id d75a77b69052e-4ffa787d0ebmr36680671cf.80.1767709678932; Tue, 06 Jan 2026 06:27:58 -0800 (PST) MIME-Version: 1.0 References: <2869012.1767023578@sss.pgh.pa.us> In-Reply-To: From: Kirill Reshke Date: Tue, 6 Jan 2026 19:27:47 +0500 X-Gm-Features: AQt7F2r3N26xanZBBAMXqRD4CPM7uhFXI66bWbP67MbNlqbBRJ2yPF8ykKz6wv4 Message-ID: Subject: Re: Define DatumGetInt8 function. To: Aleksander Alekseev Cc: pgsql-hackers , David Rowley , Tom Lane Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 6 Jan 2026 at 19:22, Aleksander Alekseev wrote: > > Hi, > > > > Kirill, are you working on this patch? > > > > Yes, PFA. > > > > > I've not studied in detail, > > > but looks like it would require making > > > char_decrement()/char_increment() and btcharskipsupport() all use > > > CharGetDatum()/DatumGetChar() and switch to using SCHAR_MIN/SCHAR_MAX > > > rather than 0/UCHAR_MAX. > > > > This is also a possible change, and can be a separate patch. I will > > try to also work on this this week. > > v1 looks incomplete to me. As I understand, Tom proposed to get rid of > UInt8 conversions as well. Are you going to implement this idea as > well? > Hmm, v1 looks good and self-contained to me. Like, anyway, making two commits (one for signed Int8 and one for unsigned) here is better for sake of atomicy? Anyway, I can see there are users of UInt8GetDatum, which are [0] and forks of Greenplum. So, I am not super-sure removing UInt8* is desirable. [0] https://github.com/duckdb/pg_duckdb/blob/main/src/pgduckdb_types.cpp#L230 -- Best regards, Kirill Reshke