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 1ph6Vd-0005OC-2P for pgsql-general@arkaria.postgresql.org; Tue, 28 Mar 2023 10:24:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ph6Vb-00029d-BV for pgsql-general@arkaria.postgresql.org; Tue, 28 Mar 2023 10:24:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ph6Va-00029T-OV for pgsql-general@lists.postgresql.org; Tue, 28 Mar 2023 10:24:55 +0000 Received: from mx0c-001a4c01.pphosted.com ([67.231.158.153]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ph6VX-0000st-6i for pgsql-general@lists.postgresql.org; Tue, 28 Mar 2023 10:24:53 +0000 Received: from pps.filterd (m0075701.ppops.net [127.0.0.1]) by mx0c-001a4c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32S711aL009537 for ; Tue, 28 Mar 2023 06:24:49 -0400 Received: from eur04-vi1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2054.outbound.protection.outlook.com [104.47.14.54]) by mx0c-001a4c01.pphosted.com (PPS) with ESMTPS id 3phuu1w7y1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 28 Mar 2023 06:24:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tg01Y4j3s9LmGTPUuDuvgeZQfHxwfMi4VQPeJPOv/ycydPWAxtUZJy1Zae/6kJnfMzyiiQiHnGYVS4SmOatf5QPkdKFR38oCbfgVtgvlOLxaDY2GcJBMX2pG/1OubyAzwnvnE+IWDY1ZWJFazRRX4+M67B+zyIIjYMW9KtEMAozcA/x98JsbwVaNg+HWVtCKOnWeBKVKTTjII25hQvmHN7eTKgVQK/FCySebRGUCzUqxUV7ZDM8ke0ep0we4AaTUIDrc2FqfcmDjR5vVzndorkZVEJEM1N4EYE8Ob6yyeq6CpyyQLP8GfS84pRlrlWEb60jCvjXjBCXov3XVMPr3pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AjLYt7j8fIiyWtR95w9eIPq11eH/rak33y8EQb60Jo0=; b=cj9kCw5Mh5k6iKwymZpWtSqd57CY5SZxduw25X8bSRvuD+jG0czu5GzCLAhc5Fb5+LaYXavVzhOvK1xH9GGADGrTKaTSEgI5KTlHCmIixTEpJrLFCO4c4Yoy8bizXWtW96GkMW53uqbMm0Rv7IidlBRVX8CR0r9fZ3Ra9mNW66AZNJZqhy2HJLzepRsJQNDWoGGJq4PqH/BO1FmezO8dbHTm4Aabt6Vm8mBAgYfUZuMZXoE5xXYBOFzMiqgGYii7VYj2Jl2AI5LLXQ0vmM/nmOjZd1PyCoqASpeD9Z+QnPnNDPijaM1XZZQTbYhaSi9tzzHRA0dAPtvqsmLrTfr3fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=4js.com; dmarc=pass action=none header.from=4js.com; dkim=pass header.d=4js.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ourvolaris.onmicrosoft.com; s=selector2-ourvolaris-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AjLYt7j8fIiyWtR95w9eIPq11eH/rak33y8EQb60Jo0=; b=uXOEokD0xIvixFFDx+czsDZscmBXI38/jk8G0wW7NyjrlOeR38XtqrPnV1sFUolbOZsisO1EEmH3GYXjCHZXzFZtbfBq9g1Pj2OtRdRrXt6a63flOpF2/y/hFf3cQw14LZFFbzn0DY1Ms2X8+ZOKjTt5D3o9ZlO9+/QQVTpQJ8k= Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:1c9::19) by PR3P191MB0907.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:4c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.33; Tue, 28 Mar 2023 10:24:46 +0000 Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::28e8:7564:6d5c:2579]) by DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::28e8:7564:6d5c:2579%6]) with mapi id 15.20.6222.031; Tue, 28 Mar 2023 10:24:46 +0000 From: Sebastien Flaesch To: pgsql-general Subject: Re: Using CTID system column as a "temporary" primary key Thread-Topic: Using CTID system column as a "temporary" primary key Thread-Index: AQHZYVZ01wVqNWW64Uy2W8xqK9Rs7a8P9A+fgAAG2DM= Date: Tue, 28 Mar 2023 10:24:46 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBAP191MB1289:EE_|PR3P191MB0907:EE_ x-ms-office365-filtering-correlation-id: 5c15423a-2176-49a8-0f84-08db2f76a76d x-volarisppoutbound: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rT1oywlD17cLd4wxPcVa2d1dM07B7UIoWKcc/Nbtn4+qLsMbO80NFWghGjlytBWSKpwPxNQI1TGVdUFrz0Wnxf1fPivSvIx3B47JsZenW8hoSSFshP+jBui/KxWEBjIABt5nnypFMm5hkL6H2dkXqZ9upUFwEIf9Kq8Cb84H50eDBcO5/OayCfRaEkM6NfM0gbI6AY5sC/are+MgE4gVROI8YZGrUJ/eIsSY9CflpvRPkYSm+Dwr/FVRuMyP7dgZyuhZGmlcqmCjO9LpkRsAGDA/iXkBByMYV7pGu42UYTuB7lbJ1n7IdFCiNaTrv1am2JR6tnOcATCVbjGxHegrSchpKKviG9Y43+5sNcCxv8JoaDiNb+PHf3J+/apJZpaSNEChsk3zw76jZzcIbyLqYl7PTx9MCSSO9+OSkkmpNknUXA9/Z2u3qfK5LTnXM61VoQFN3vOoRVK/hL+vcj6I9CBvWLlsXla6uGesA5jgNwvpKvY2tPmyHLrpztBH5SW007mqHsMeONGunDPgdVDyYB26NIJsVkkk+hqeve7eFznHD+FGccwsDICchxUw6y40cdANLmP4O8+RXD4yxiTKFBWJgsiTVrkVLHIXteevfjI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBAP191MB1289.EURP191.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(39860400002)(396003)(366004)(451199021)(2906002)(44832011)(21615005)(38100700002)(41300700001)(8936002)(122000001)(5660300002)(52536014)(86362001)(55016003)(33656002)(166002)(38070700005)(6916009)(316002)(19627405001)(7696005)(71200400001)(966005)(478600001)(26005)(53546011)(6506007)(9686003)(83380400001)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(76116006)(91956017)(186003)(2940100002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lfbb31Cjp21lCfYHZfNnZ8zf4LtQY2fPen1+1+dyHhGpq63FZPlpkW7Hl3AY?= =?us-ascii?Q?QnWKxkALp2HjMl6NvQu09ZMFxn0TxDgTojwT/rII9GabouE3Q7+AascoiW51?= =?us-ascii?Q?VGwNVaXofXn5PaQDag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?= =?us-ascii?Q?rntW1NvegxQfVlGRttrlvdrWnrqYWaEM4XyJhvnsZEpLuokb4Whrkx33/SHf?= =?us-ascii?Q?zmBIfqlRdMBW9UQCASClFIDphaTTtEuL90Ztmvh/+INcQXaYZAXkBF9MM0V5?= =?us-ascii?Q?mBjYxrNh24W6bNNLYkYjDCBCE0Iy4l7eMgf5ToqtwRowsS5fIswSyULslGfA?= =?us-ascii?Q?/uaGvc/zaFzdU3q0APNsVt/IhPn43VSThzIsu48HprlaqSqEkStytMGim4Vm?= =?us-ascii?Q?ppgaQT3pncuHvmUDayyjpfcyblLlippwbm0Le7YPL55HuMAU/YeiETiHajdy?= =?us-ascii?Q?1DWPIeSNgB37xffBb4PNWw8/g2sO0yrlRqtOefcGPcO4TGLP9ZdRPWIMtBxT?= =?us-ascii?Q?BEW0xo7P0RsTc6ETi4iXVXljEPP1B+YuVe3wcV03eSs6RyA+MLvXBma8xeYJ?= =?us-ascii?Q?uwbIm5rVIENR4a7MzZyOvSBAg6ZdHS8u+B8sSW455+k7U8Ew0kYi0CPvW4Rw?= =?us-ascii?Q?EVNFlqp1QyYFDogDDEcyX8XIcQovPP6IivPL9RCunA8DrWK/S5vNNHAgdAWO?= =?us-ascii?Q?7js/HSw3Q3gEuaXHg9kMGLwO2lUkgQtMBQRyoKYY?= Content-Type: multipart/alternative; boundary="_000_DBAP191MB128920D3A4B5DFB03ED61D1BB0889DBAP191MB1289EURP_" MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: udrmpcXorSZcDZYkDjhP1Ctpu3grYI6M7F+0oxnqPFlon4dSg5hsBxUOQtgDJ09U3dQHe+VKiP5MSvmjb7ohBzF5kWyNIrlTQciKizx52y5XI9VU8HywlxuMtylgfPZYx7E2Tts1IHk3oy63mfTd1OT4y2Lr3+QOoMDthTIXQU0PmOsVW7AOKEGVDFtMBaN+0UibrEPAuU1PEXqRWn5bW0AtrOZjzMzlVBuikHdBw6ueUfQw7XTcLvEH5/nJhiV57ZZIC0s2EZpxZX4Xcoq0r1FxEvdIEV/cLcbICdR7W6IA0/k3WEY7g7/dmITejlYrxM2qOD/CB3o9dS5Tz/VgR0DhdMSwMIXafH3pZMob1wWF21wKIox5x2uHXsRsAqqyRMCLVhIegUB4loe6WuL+Ovx2r0F9MLYiZFFpSbIzA3SIqzx+/5wETc5h5PjE69VNK42yeoKHU1R7GffERWCdYJnRvWtMuYfcqIMtpKD0RELo/qOVSjEkTRq25L7HpnCjQN6Pf37pZpmX9L8abL2nRgHXSFhG2HgsxX+GSsGQZXmcqT3O89uxpFofH8ViTVW5VuqpMJRkFABclISOCTeZopAkEsw3JXzLM3uZ8OZbn4YtLfZglfxMnm8z7xkFuSjiUwzKiVRmPRnrTsTa9orFMYPx3ysKrLLdk7FcLMbL1tdcbUMwtYiRTV/Yg7Izc5Wzlb4NSqEY0+Zyl73Ks8ZXdIRzneWOVJY+xe8NL2zELDX9VZZ94coiYeeXDl6jaK2jMG3EY7xuZn5ickmT/SKOEElr7EgZjd0FxwxCLh96Lm5+sRJ3mIAoDqoML2X/7Mkn X-OriginatorOrg: 4js.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBAP191MB1289.EURP191.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 5c15423a-2176-49a8-0f84-08db2f76a76d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2023 10:24:46.4180 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 75c696ec-5bfb-4892-9a0c-9187a9061cd6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qttgbNtRRT2FCz0TqDN6E7hz2laWgJogH4DE0cOUU5KukmvxmRR9muAzM5YHcAyPj+W7d9aeMml1GV2rJgMQU97QjofGQ5r7C19wN1Zi6wg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P191MB0907 X-Proofpoint-GUID: iySNBuzOiErNqiKlGxbenkcxjsyye-BQ X-Proofpoint-ORIG-GUID: iySNBuzOiErNqiKlGxbenkcxjsyye-BQ X-ProofpointHeader: Yes X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 bulkscore=0 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303280085 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DBAP191MB128920D3A4B5DFB03ED61D1BB0889DBAP191MB1289EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable How large can the string representation of a CTID (TID type) be? This page mentions 6 bytes for t_ctid / ItemPointerData... =3D> how can I deduce the max size of its string representation? https://www.postgresql.org/docs/14/storage-page-layout.html Seb ________________________________ From: Sebastien Flaesch Sent: Tuesday, March 28, 2023 11:57 AM To: pgsql-general Subject: Re: Using CTID system column as a "temporary" primary key EXTERNAL: Do not click links or open attachments if you do not recognize th= e sender. I mean Oracle's ROWID of course, not ROWNUM. ROWNUM is temporary in the context of the SELECT, so it cannot be used in s= ubsequent SQL statements. Seb ________________________________ From: Sebastien Flaesch Sent: Tuesday, March 28, 2023 11:28 AM To: pgsql-general Subject: Using CTID system column as a "temporary" primary key EXTERNAL: Do not click links or open attachments if you do not recognize th= e sender. Hello! We are looking for an equivalent of Informix ROWID or Oracle's ROWNUM. Is the CTID a good choice? I assume it must be used in a specific context, and of course not considere= d as permanent primary key. I understand that if the row is updated, the CTID may change. Where can we find details about the validity and lifetime of the value such= column? Will CTID be supported long term or is there any plan to remove it or hide = it some day? Of course, one should use a real primary key definition. However, we have l= egacy code to adapt to PostgreSQL, and in some cases, tables have a composi= te primary key. A first SELECT uses that primary key, but it also fetches t= he ROWID, and will use that one in a subsequent SELECT, UPDATE or DELETE, i= nstead of carrying the composite pkey values. Seb --_000_DBAP191MB128920D3A4B5DFB03ED61D1BB0889DBAP191MB1289EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
How large can the string representation of a CTID (TID type) be?

This page mentions 6 bytes for t_ctid / ItemPointerData...
=3D> how can I deduce the max size of its string representation?


Seb

From: Sebastien Flaesch <= ;sebastien.flaesch@4js.com>
Sent: Tuesday, March 28, 2023 11:57 AM
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Using CTID system column as a "temporary" pri= mary key
 

EXTERNAL: Do not c= lick links or open attachments if you do not recognize the sender.=

I mean Oracle's ROWID of course, not ROWNUM.
ROWNUM is temporary in the context of the SELECT, so it cannot be used in s= ubsequent SQL statements.
Seb

From: Sebastien Flaesch &= lt;sebastien.flaesch@4js.com>
Sent: Tuesday, March 28, 2023 11:28 AM
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Using CTID system column as a "temporary" primary= key
 

EXTERNAL: Do not c= lick links or open attachments if you do not recognize the sender.=

Hello!

We are looking for an equivalent of Informix ROWID or Oracle's ROWNUM.

Is the CTID a good choice?

I assume it must be used in a specific context, and of course not considere= d as permanent primary key.

I understand that if the row is updated, the CTID may change.

Where can we find details about the validity and lifeti= me of the value such column?

Will CTID be supported long term or is there any plan to remove it or hide = it some day?

Of course, one should use a real primary key definition. However, we have l= egacy code to adapt to PostgreSQL, and in some cases, tables have a composi= te primary key. A first SELECT uses that primary key, but it also fetches t= he ROWID, and will use that one in a subsequent SELECT, UPDATE or DELETE, instead of carrying the composit= e pkey values.

Seb

--_000_DBAP191MB128920D3A4B5DFB03ED61D1BB0889DBAP191MB1289EURP_--