Re: BUG #19429: An issue regarding the processing of Oid as an int type in ecpg - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19429: An issue regarding the processing of Oid as an int type in ecpg
Date
Msg-id 2247548.1773615628@sss.pgh.pa.us
Whole thread Raw
In response to BUG #19429: An issue regarding the processing of Oid as an int type in ecpg  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #19433: json_object_agg_unique Crashes When Used as Window Function
Next
From: Felix Hamme
Date:
Subject: Re: BUG #19432: recovery fails at invalid checkpoint record