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 1ttWm1-00Ddwh-Qz for pgsql-general@arkaria.postgresql.org; Sat, 15 Mar 2025 19:02:17 +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 1ttWlz-001JzX-V2 for pgsql-general@arkaria.postgresql.org; Sat, 15 Mar 2025 19:02:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ttWlz-001Jyf-JY for pgsql-general@lists.postgresql.org; Sat, 15 Mar 2025 19:02:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ttWlv-0033Z6-33 for pgsql-general@postgresql.org; Sat, 15 Mar 2025 19:02:15 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52FJ28SR3498257; Sat, 15 Mar 2025 15:02:08 -0400 From: Tom Lane To: M Tarkeshwar Rao cc: "pgsql-general@postgresql.org" Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID In-reply-to: References: Comments: In-reply-to M Tarkeshwar Rao message dated "Sat, 15 Mar 2025 18:53:08 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3498255.1742065328.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 15 Mar 2025 15:02:08 -0400 Message-ID: <3498256.1742065328@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk M Tarkeshwar Rao writes: > We are using PostgreSQL libpq in our application. The code worked fine f= or the past four years, but after upgrading the library, the function PQft= ype is returning unexpected values for some columns. > Specifically, the issue occurs with a column of type timestamp(3) withou= t 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 12= 3456; 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