PG Bug reporting form <noreply@postgresql.org> writes:
> Part of the code caches and calculates the Oid as an int type in ecpg.
> We know that Oid is unsigned int. When the Oid value is greater than or
> equal to 2^31, it exceeds the value range of the int type. There are
> potential problems in processing Oid with the int type. For example, when
> formatting Oid with "%d", negative values may occur.
> Through analysis and testing, it is found that the ecpg part of the code has
> not caused any problems so far, but it is running in an obscure way.
Yeah, it does work as-is, but it's relying on undocumented details
about what the server will do with something like "oid=-1".
I reviewed your patch and pushed it. For future reference, it's not
great to send patches via our bug report form; whitespace gets mangled
and it's quite painful to reconstruct. Better to just send email to
pgsql-hackers with the patch in an attachment.
regards, tom lane