Never seen a negative OID before.
... attrelid=-1519044407::oid ... ... rel.oid = -1519044407::oid ...
The
oid
type is currently implemented as an unsigned four-byte integer.
That OID is just wrong. Looks like a wraparound, followed by buggy handling in pgAdmin4. Postgres tries to apply the unary operator -
after casting the numeric literal to the type oid
, which fails for the reported reason: no such thing for type oid
. This, oddly, "works":
SELECT '-1519044407'::oid; -- returns 2775922889
Which is the same as 2^32 - 1519044407
. Effectively, a signed integer, misinterpreted as unsigned integer. Looks like a bug in the Postgres cast to me.
The more pressing question: where did the odd literal come from? Are you burning insane amounts of OIDs in your DB to trigger this wraparound? Using tables WITH OIDS
? (Nobody should any more. The feature is deprecated and removed in Postgres 12.) Or did something (someone?) mess with your system catalogs? Maybe a bug in pgAdmin4? Are you running the latest version? v4.12 at the time of writing.
The query could be "fixed" by quoting the oid literal like above. But do you actually have a row with OID = 2775922889 in your DB? Test with
SELECT * FROM pg_class WHERE oid = 2775922889;
Oddly, the same as:
SELECT * FROM pg_class WHERE oid = '-1519044407';
And:
SELECT * FROM pg_class WHERE relname = 'test_table'
You might have found one or more bugs here: in pgAdmin4, Postgres and/or in your database design and/or system catalogs.