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 1ttkK0-00Gdmh-IT for pgsql-general@arkaria.postgresql.org; Sun, 16 Mar 2025 09:30:16 +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 1ttkJz-00BSAJ-0F for pgsql-general@arkaria.postgresql.org; Sun, 16 Mar 2025 09:30:15 +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 1ttkJy-00BSAB-6B for pgsql-general@lists.postgresql.org; Sun, 16 Mar 2025 09:30:14 +0000 Received: from mx0d-001a4c01.pphosted.com ([67.231.151.23]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ttkJt-0037po-1A for pgsql-general@postgresql.org; Sun, 16 Mar 2025 09:30:12 +0000 Received: from pps.filterd (m0210020.ppops.net [127.0.0.1]) by mx0c-001a4c01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52FMXri1015994; Sun, 16 Mar 2025 05:30:06 -0400 Received: from eur05-vi1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2172.outbound.protection.outlook.com [104.47.17.172]) by mx0c-001a4c01.pphosted.com (PPS) with ESMTPS id 45d2w645gy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 16 Mar 2025 05:30:06 -0400 (EDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NGYzQ3gg0iQ6n+arOLecN3CTjXcFaURRRnBxJCGlKHJtTYO0lNNpRWpKurxe7vMMKRONcrahfBQqewvhtC8QER3buHTvqUx3jZkc7pY/sP1Cq7+8uEuVC3C4ptO8qa0l1iQ7U5R6zzl8UnHX16br/o4DCKtvyE36ZWPCLWy1rD/mPu54jQ5mosiHCa4N2oQ3OYYntEXZFTE1WoUXq2dz+v0ktpCmgrOZ/c8FQPQqaSUl6je68fStOMDAOAjlXuR7QiKEf15WtI/kQgvjqeHsiVrJ7t6pUhC17o/QodElm/NTOdMl+TIcwDrC+U0ll250RHYS1ZeGIGEP2XpznZrRhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=YWABSmZvW6GhW1WvojplOZEPO7RglKdVEH07WSKC2Mg=; b=rD+tM3p4xaWwkMPDtyplYJmlGwN5vRHqsC0pxOVABG8tbn3RK7SGh/apkCyb6vZMGnTKGMFh0O0KItPJkEHyD2mj9R6s9wgukJwFhfoxI0Yx25WQbpqzfMQLRIjkXT9QmEM+AAr5BWwqrIVbTARfO2wyhwjph75assKAnpiAV3xzp70RoqqvASzszgXUcin6wZrmu0t4Y57MLfqn/toea/U80CJM8POEcOJOJoQtQWFL81xVUPazFdImPHcGqAF867o25TTht8X72pmv00ZGFTTSZsbJzympl22TaykywqiJaLFcNIk9hWpo04PHe94u60Z8G43F8LvHWuM2eyUJrA== 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=YWABSmZvW6GhW1WvojplOZEPO7RglKdVEH07WSKC2Mg=; b=QaQVIYtirwAY1vrREMozlhtXzyBkoR7npCKoJaZVFmclOHSR03uog0A0Dx+Fmgo0Hppif0NE8pNb5gMuqk2YYaY1YW+8lESdBzXwGnCNc7lYH4J4op8IzdGtYSVSf9QcLn0evAdCfEqz6CtiHN5bVsUx38C+9x2OigXOrViuCKE= Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:1c9::19) by VI0P191MB2702.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:252::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.31; Sun, 16 Mar 2025 09:30:02 +0000 Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::9a60:21a1:9aa2:cdb0]) by DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::9a60:21a1:9aa2:cdb0%4]) with mapi id 15.20.8534.031; Sun, 16 Mar 2025 09:30:02 +0000 From: Sebastien Flaesch To: Tom Lane , M Tarkeshwar Rao CC: "pgsql-general@postgresql.org" Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID Thread-Topic: After upgrading libpq, the same function(PQftype) call returns a different OID Thread-Index: AduV23zLkRPb77LLTluClfIN9ptbAwAAUL0AAB4WV3I= Date: Sun, 16 Mar 2025 09:30:02 +0000 Message-ID: References: <3498256.1742065328@sss.pgh.pa.us> In-Reply-To: <3498256.1742065328@sss.pgh.pa.us> 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_|VI0P191MB2702:EE_ x-ms-office365-filtering-correlation-id: 5d144d56-e98a-44bb-6ca9-08dd646d2129 x-volarisppoutbound: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|1800799024|38070700018|8096899003|7053199007; x-microsoft-antispam-message-info: =?us-ascii?Q?hSAY+SsHNoKh+CZZt66uL+QB5t1zIXtWEoV+PdUEYJNQ2XvG248ioKM1win5?= =?us-ascii?Q?+LwVq+dDIxLH60ZWPOz/yTudyRIcaNvX7Ve/GGcaRIRp1LkQ6Yia2Uf3Cno+?= =?us-ascii?Q?g81iygwsBJf4ZoGwakoWh5QjIdJLASYdxNNAKLf09KuunvUUvEms6WFIuyy+?= =?us-ascii?Q?QzIxMIz/psi2+a43axxBuvYMphRUZKkyZs1zuxYWGvrKXdwmLDl3IPZG3q2O?= =?us-ascii?Q?yrFJWoLeKIQlRFXb4eD3Wo2JKYtuuhdh9yGrG1/mjZeBN4Gyb53N27+xsk8R?= =?us-ascii?Q?bonR+CSX3S575IvHoNmSAZG4KkjtG+tTlSncrJgo8JpJmO+YyyNpGoaEM0Zy?= =?us-ascii?Q?clS00esvAR8DHziiQ85AA4hkXwYIrfANRZP18oEfYE0P5g+ARJD5+mj1aTLQ?= =?us-ascii?Q?6GpO900b7nKS5k59SXFXOl7QOU+rIB+PSP6DUVv8l+Vv7m2Pk720kfKIqTPJ?= =?us-ascii?Q?/41ZcHfGrCBBE1uTee91VIwJU/L47AV7D9ceecD685FXC9IayNRybCOngiDV?= =?us-ascii?Q?dEzo8jWGh/mfNEzHH02nbVCmkgg7yxKu3BBQSzimD2fUcl83erAW8nF3JSLZ?= =?us-ascii?Q?43uugA76LqWtboo2PX0PhoICVTcVbYqnLZa9epeiQRJGVdq3VnzGbYNtLS2L?= =?us-ascii?Q?8FdxZsr1IZB7QUTSst4Y7H5MqMAfZ+JEttBcUySbo7fIOwjILgforG7R+dPc?= =?us-ascii?Q?2fXSyO7ORZYAOjoIdMBPS6e63P+5polSQ841TlMfB+PISmKH6nI8IV5V5Dk4?= =?us-ascii?Q?6cl+aIOPUfUfh3Qey2tvyojdzCvGLrS0obJSVjtfORmW+N6LbLalx87VEDa0?= =?us-ascii?Q?UDpGatLbkRSvP2zt6cJnhOOvr/f2oKfsyICuEMBFZNtBHfo334dBXLm8z6uN?= =?us-ascii?Q?W3LYmqTdwYQl+FlQs+7GfOT0/19PtwxiYIDSrhKV9O/8nPSs1VD5ptJvSq8w?= =?us-ascii?Q?Enbiz7JiEi7BPmFRCpbpdTVEHZpALo7GXutzwY1liEcUq8LcsDupa57FBerN?= =?us-ascii?Q?1aqgEgXQhyJ1YJFyMTZIHTPD4Zc71V2gJRWQcuqd1PxTuvRiWu+PWfL4O3b3?= =?us-ascii?Q?K9eGslDS2ljprl20N1++ggXGvfqK7/I54xcuSbESApF6x/Plotq39yhGWHQp?= =?us-ascii?Q?U9T55u0Qa6gU0TIj21YdCZm/XkwrIc615DF4MzC98gXPuTYI5G7gWp0BoA2H?= =?us-ascii?Q?dHpruT61m/u9d+OKNTiqHcd5+S00Cb3uz07bfYTg19/NZnDaQULCkOG8uWZo?= =?us-ascii?Q?u9ZR8m0BtTAJ+TJiaz4wZJIkE/qsPxJRyVdjSLmODErrvgWMNTp3qISOUwpM?= =?us-ascii?Q?x/8AH7pUpifqBXvEG1HpnGjqyEHbi2M/tTEsbeaPtLSMo+UIz1LKGmp+CjpI?= =?us-ascii?Q?BkaRkdk/6kEtglCX8Ae8iCtDvFnVgMJcYLSqMLyW/MJVnOZ2bQ=3D=3D?= 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:(13230040)(376014)(366016)(1800799024)(38070700018)(8096899003)(7053199007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5+CBfSRrTmGbDg3KjIl+/SO5Q6EMEyRcR21L1lYJ0wl7XAjGiLEyo9Ym7zhs?= =?us-ascii?Q?bUDMA+X8bJWuPI42MqKdTuwcxu03W68L9Dn07CHKP7fIM2/rkGW7Yss3vE5C?= =?us-ascii?Q?8GMMFVa0AViH0DUmZdWTV8fS/s2Jqfxbmj/Yk8rTX9fVUyHTloFRZKf2b83q?= =?us-ascii?Q?AchqG0T6iim3Y5Sw+3v5H5S1tcyV1/LSwKeEreGklHe+G/sbVcJWh002vfOF?= =?us-ascii?Q?6sKIQx62Yb3MtkjMjGkWlacOIqJr/SY2SWSbIpPRMx917sVXxjTnoRhLBTT3?= =?us-ascii?Q?t2uNW/I2HtAhJ0Q6GnuNCSI+5R6PlYBrKg3HPofNxrAaGOJYNIq5Ay6bax26?= =?us-ascii?Q?Iu7rfawwef9417wH5jNcEXT9lqqWtG4TnGz0vK59herj8pWFQHd8+p02TuEc?= =?us-ascii?Q?xkoHBw6CzNkZYXt200veD1rBKuNOaHdp0kUeeeeqzUQweMAXC/yOdZg7Q5IH?= =?us-ascii?Q?af6HUkngFPvXGH0MPe19g1Ih7xIGdnFWRH4VxItFHsWKoMCxDnzIw6+BNHGc?= =?us-ascii?Q?6HPWn+HDNmH2Q3oDcwpwYPyw2V+iFkK+Z7k4zRcnaDC4UkYycn0CLRZzUDB7?= =?us-ascii?Q?TeRmq2rxjSvZuDNcFrcbK56+kDworiryk+2KGdQncPajzvAcllZBQ2U8oc4p?= =?us-ascii?Q?TZUv9r3XPD/pNZmi152RGeOJpmITWbYmAHaousVDWvknzF8db3QE3oecTkYP?= =?us-ascii?Q?Wdcfy75A4WSQqycXVo0w4784LvzvCVjHUiH9RbTvxbqop/B6GsdtcKPMrvcv?= =?us-ascii?Q?Snh0BnBzJcKNGW2pXZbEhFTH1Zv6ClytfERJg5HAkCyTga1Bn6BnGPa29v1z?= =?us-ascii?Q?XRZNC8dMGD6WShPTqmQphVvScI9ackPHP5MmubSz4TJcsXt7uGltDT3ytYCm?= =?us-ascii?Q?X91n54xJPGldv6zVhsRiL7vaIOo6wyUCn/DpGrO3cd9/Lwm9gc26fY5MAFgm?= =?us-ascii?Q?XyOf7tniu/l1bjDg5i2gPQGybZaHLxZ2g/b/P7QNvSy0Tr7IfgOl1oSZu0mZ?= =?us-ascii?Q?uYJ6jhE3ewJV4wHN/jyWcccBgOttTurJuYjIwiq0OOXnPa+UWenesozrjAi9?= =?us-ascii?Q?MsutvmHUpPwdjNthZDviRcc+rgzWYi+dvJiaobOaD4CPKZ+kqN13jVAJwhpD?= =?us-ascii?Q?J0s2SZadNj6eSwzs/S7NTzOJ+K3lOJHBEPzvmIMWWWS1MxGIPtk7p0rSMF5t?= =?us-ascii?Q?m5H0vydC43bBxNS58W9RK+z0almN+M5o5LRQhBda74qdmdDfWTMsAUstbFQ6?= =?us-ascii?Q?roIBDtPVNZOEAuotCyqNG9e0njkWsxZsds3lc+YUjweIuDhfwVrOk5WA6yER?= =?us-ascii?Q?2AdiC5ShFeJAj9dg+rqTO/LA9/iXt4pAUEfsBUkq3f4gLSdRGDaa9PiDucKz?= =?us-ascii?Q?gC04mUCM4o0TmbCWfdhKY/16IYbtRuzBSK7hs4HClwqLMJME24tNSn9pvnvg?= =?us-ascii?Q?j8jdAliznwkke91h9AtP/qq5lfxROtGGsAoTiQeT8LBO6C2n8Dj6MxG6X+KQ?= =?us-ascii?Q?9P3LTsXz5G5IxTjIDBqUfiRzoh9PridR7yMKtroCwY6h0SSeH53pJee6eA3Z?= =?us-ascii?Q?cCJ8AY9iBf9vCg7Pjpm8Nhkx7q9MFHBs66UErzVJ?= Content-Type: multipart/alternative; boundary="_000_DBAP191MB1289124F5D8690DF3F72F62CB0DC2DBAP191MB1289EURP_" MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: XZaw/fsA7HsfIQfQCKCC9q4WgSXaOR8wEtVKUOyt44hXOs8BwZnxSwhbrJGNCPeliBdHBN4EX6SqEGXCoPabk0ZsHAxI2nFtT6636OgJNMTeFiJW0uDE2L/T2LpKHW4rrXwbWG4Iui7db4FYtvi4dYnSVXmNCXgs4Mi2TBUwhuZFKnkIwoor/vgiJouesWyOSIMhw6imLVchCPrRXLhSiunVsRUrO5jaXijzWYpDWoXfSiQlMWuklPqssh10jI9Nbz1mbmg5/LZBUeSAvoOHjpfFZaIaJIELbjpsDmNEha+XlOesEnP8HM7kcXfzaZpbOGnZ3UylyLJ1A8BN50TtX/fpwu9Vr0r+7N04SG5mbF5Bq41CInf0v6PgDh3YcDsCC0u+JH7kZkNw+i3r+6/EjXev+MMXg70c5HITL5iiF0MidIFYtreyA1U+J9pZrY8sIcIPLL8LJOSSlewdzVG+2Go2uweQnB8lE3pVDD5daT0UaGviV9z2z2nkS2TSPpyKsGsZ2X9sOGwPq5lXqMX7mGVhWyKGc9+PKo1wPYDfR+391g5OLvxYt6D8NhHmCte00XBNK+eDAGCs5pvC7uL6WBR+UWxzYLHzlE3hfEIAvbcJNnz5OFE1NR44OqV+Z0yuOrE8eUyZdGvHTQy3eU68PA== 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: 5d144d56-e98a-44bb-6ca9-08dd646d2129 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Mar 2025 09:30:02.6486 (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: 0SZa7dhuOcn+pH8HJFemIJbW45LKsBPBS7CmIkXedoajTOVddXYQvkzIj2pxljEzjZ1Z/Aq1EY9PPvCD9sZDdAzBOcsJJI5eMSXLuIOuFKM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0P191MB2702 X-Proofpoint-GUID: R2vXUMXwR0amXiBz5EAk9z-uwpZVxr0T X-Proofpoint-ORIG-GUID: R2vXUMXwR0amXiBz5EAk9z-uwpZVxr0T X-Authority-Analysis: v=2.4 cv=eNwTjGp1 c=1 sm=1 tr=0 ts=67d69a1e cx=c_pps a=nBrI8LKFnEUVNABbkVKS9g==:117 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=Vs1iUdzkB0EA:10 a=H5OGdu5hBBwA:10 a=udrfY5dcTTYA:10 a=epTmVMiNAAAA:8 a=0FD05c-RAAAA:8 a=MWkNQP7Y2sHaHhFu8zwA:9 a=CjuIK1q_8ugA:10 a=dy8i-Y04Ge0A:10 a=2SZzFt4ev9gA:10 a=x6bR53Zc4_I6SNRxjyYA:9 a=Yf7eeBDn6qeg2OKm:21 a=frz4AuCg-hUA:10 a=_W_S_7VecoQA:10 a=l1rpMCqCXRGZwUSuRcM3:22 X-ProofpointHeader: Yes X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1011 bulkscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 adultscore=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.21.0-2502280000 definitions=main-2503160067 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DBAP191MB1289124F5D8690DF3F72F62CB0DC2DBAP191MB1289EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, I think the column type identification with PQftype() needs some review/cla= rification. It's a pity that libpq does not have an API to return directly the actual t= ype name of a column. The doc s= ays: You can query the system table pg_type to obtain the names and properties o= f the various data types. The OIDs of the built-in data types are defined i= n the file catalog/pg_type_d.h in the PostgreSQL installation's include dir= ectory. After building PostgreSQL 17.4 from the sources, I cannot find this pg_type= _d.h header file in the installation directory. Maybe I am missing some con= figure option? Anyway, I found the file in the sources: src/include/catalog/pg_type_d.h And I can read this comment: /* * Backwards compatibility for ancient random spellings of pg_type OID macr= os. * Don't use these names in new code. */ #define CASHOID MONEYOID #define LSNOID PG_LSNOID #define BOOLOID 16 #define BYTEAOID 17 #define CHAROID 18 #define NAMEOID 19 #define INT8OID 20 #define INT2OID 21 ... I am expecting something like: #define PG_TYPE_BOOL 16 #define PG_TYPE_BYTEA 17 #define PG_TYPE_CHAR 18 #define PG_TYPE_NAME 19 #define PG_TYPE_INT8 20 #define PG_TYPE_INT2 21 #define PG_TYPE_INT2VECTOR 22 ... Seb ________________________________ From: Tom Lane Sent: Saturday, March 15, 2025 8:02 PM To: M Tarkeshwar Rao Cc: pgsql-general@postgresql.org Subject: Re: After upgrading libpq, the same function(PQftype) call returns= a different OID EXTERNAL: Do not click links or open attachments if you do not recognize th= e sender. M Tarkeshwar Rao writes: > We are using PostgreSQL libpq in our application. The code worked fine fo= r the past four years, but after upgrading the library, the function PQftyp= e is returning unexpected values for some columns. > Specifically, the issue occurs with a column of type timestamp(3) without= time zone. The OID of type timestamp has not changed. Perhaps you are now querying some other table. I'd suggest looking into pg_type to find out what type is represented by the OID you're now getting, and then searching pg_attribute to see what's using that. select typname from pg_type where oid =3D 123456; select attrelid::regclass, attname from pg_attribute where atttypid =3D 123= 456; Also, if you really do mean that you changed only libpq and nothing about the server side, I'd have to guess that you're connecting to some other database than before. That would be surprising, but with zero details it's hard to debug. regards, tom lane --_000_DBAP191MB1289124F5D8690DF3F72F62CB0DC2DBAP191MB1289EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

I think the column type identification with PQftype() needs some review/cla= rification.

It's a pity that libpq does not have an API to return directly the actual t= ype name of a column.

The doc says:

You can query the system table pg_type to obtain the name= s and properties of the various data types. The OIDs of the built-in data t= ypes are defined in the file catalog/pg_type_d.h in the PostgreSQL installation's= include directory.

After building PostgreSQL 17.4 from the sources, I cannot find = this pg_type_d.h header file in the installation directory. Maybe I am miss= ing some configure option?

Anyway, I found the file in the sources:

   src/include/catalog/pg_type_d.h

And I can read this comment:

/*
 * Backwards compatibility for ancient random spellings of pg_type = OID macros.
 * Don't use these names in new code.
 */
#define CASHOID MONEYOID
#define LSNOID  PG_LSNOID

#define BOOLOID 16
#define BYTEAOID 17
#define CHAROID 18
#define NAMEOID 19
#define INT8OID 20
#define INT2OID 21
...


I am expecting something like:

#define PG_TYPE_BOOL                = ;      16
#define PG_TYPE_BYTEA               &nbs= p;     17
#define PG_TYPE_CHAR                = ;      18
#define PG_TYPE_NAME                = ;      19
#define PG_TYPE_INT8                = ;      20
#define PG_TYPE_INT2                = ;      21
#define PG_TYPE_INT2VECTOR              =  22
...

Seb


From: Tom Lane <tgl@sss.= pgh.pa.us>
Sent: Saturday, March 15, 2025 8:02 PM
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>= ;
Subject: Re: After upgrading libpq, the same function(PQftype) call = returns a different OID
 
EXTERNAL: Do not click links or open attachments i= f you do not recognize the sender.

M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com> writes:
> We are using PostgreSQL libpq in our application. The code worked fine= for the past four years, but after upgrading the library, the function PQf= type is returning unexpected values for some columns.
> Specifically, the issue occurs with a column of type timestamp(3) with= out time zone.

The OID of type timestamp has not changed.  Perhaps you are now
querying some other table.  I'd suggest looking into pg_type to
find out what type is represented by the OID you're now getting,
and then searching pg_attribute to see what's using that.

select typname from pg_type where oid =3D 123456;

select attrelid::regclass, attname from pg_attribute where atttypid =3D 123= 456;

Also, if you really do mean that you changed only libpq and
nothing about the server side, I'd have to guess that you're
connecting to some other database than before.  That would be
surprising, but with zero details it's hard to debug.

            &nb= sp;           regards, to= m lane


--_000_DBAP191MB1289124F5D8690DF3F72F62CB0DC2DBAP191MB1289EURP_--