#95 large OID not supported?

open
nobody
PgSQL (41)
5
2007-02-27
2007-02-27
petit_vic
No

I am working on system tables and at some point I need to get the "oid" value from pg_class table. I noticed that when I try to get this field for records with too high value, I don't get the value but 2147483647 = 2 ** 31 - 1.

For example if I try to get the max(oid) from pg_class which is 4169345710, I get 2147483647.

Can somebody help on this?

Thank you very much,

petit_vic

Discussion

  • Logged In: YES
    user_id=698599
    Originator: NO

    Some random thoughts from a passer-by: if I had to guess, I would say this is a bug in the handling of the PG_OID type in pgresult.c - strtol(3) returns LONG_MIN on under or overflow. The logic in libPQgetvalue for the PG_OID case is too subtle to for me to immediately see what the problem is - I'm not sure what the oidCache is being used for.