clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 818513 fiddles created (9187 in the last week).

SELECT 2^32 - 1519044407;
?column?
2775922889
 hidden batch(es)


-- fails as expected: SELECT -1519044407::oid;
ERROR: operator does not exist: - oid LINE 2: SELECT -1519044407::oid; ^ HINT: No operator matches the given name and argument type. You might need to add an explicit type cast.
 hidden batch(es)


-- (surprisingly!) works: SELECT '-1519044407'::oid, '-1519044407'::int::oid, oid '-1519044407', (int '-1519044407')::oid;
oid oid oid oid
2775922889 2775922889 2775922889 2775922889
 hidden batch(es)


-- works as expected SELECT 2775922889::oid, '2775922889'::oid, oid '2775922889';
oid oid oid
2775922889 2775922889 2775922889
 hidden batch(es)


-- differs! SELECT (oid '2775922889')::int , (oid '2775922889')::bigint;
int4 int8
-1519044407 2775922889
 hidden batch(es)


-- fails as expected: SELECT '-1519044407'::bigint::oid;
ERROR: OID out of range
 hidden batch(es)


-- fails as expected: SELECT (bigint '-1519044407')::oid
ERROR: OID out of range
 hidden batch(es)


-- fails as expected: SELECT '-1519044407'::numeric::oid;
ERROR: cannot cast type numeric to oid LINE 2: SELECT '-1519044407'::numeric::oid; ^
 hidden batch(es)


-- fails as expected: SELECT '-1519044407'::float8::oid;
ERROR: cannot cast type double precision to oid LINE 2: SELECT '-1519044407'::float8::oid; ^
 hidden batch(es)