Re: After upgrading libpq, the same function(PQftype) call returns a different OID

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: M Tarkeshwar Rao <m(dot)tarkeshwar(dot)rao(at)ericsson(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID
Date: 2025-03-15 19:02:08
Message-ID: 3498256.1742065328@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

M Tarkeshwar Rao <m(dot)tarkeshwar(dot)rao(at)ericsson(dot)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 PQftype 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 = 123456;

select attrelid::regclass, attname from pg_attribute where atttypid = 123456;

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2025-03-16 00:14:14 Re: Disabling vacuum truncate for autovacuum
Previous Message M Tarkeshwar Rao 2025-03-15 18:53:08 After upgrading libpq, the same function(PQftype) call returns a different OID