OID out of range

From: Konireddy Rajashekar <rajkonireddy(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Cc: rajkonireddy(at)gmail(dot)com
Subject: OID out of range
Date: 2020-01-15 18:18:39
Message-ID: CAGpkkhtm8XOa2J9NBuRkSiXoR0ipimvQiFdd+wKpd7XBeayFpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am getting ERROR: OID out of range while firing below SQL , what could be
the reason? I am joining pg_class and one user_created table to compare
tables size.

select u.relid,c.relnamespace::regnamespace::text,c.relname,now() as
current_time,pg_size_pretty(pg_relation_size(c.oid)) as
current_size,pg_size_pretty(u.table_size) as
previous_size,pg_size_pretty(pg_relation_size(c.oid) -
pg_relation_size(u.table_size)) as diff from user_tables_sizes u join
pg_class c on u.relid::bigint = c.oid::bigint where c.relkind='r'
and c.relnamespace::regnamespace::text='rpx_reporting_stage' and
u.captured_dt::date=current_date - interval '1 days'ERROR: OID out of
rangetest-# \d user_tables_sizes
Table "user_tables_sizes"
Column | Type | Collation | Nullable | Default
-------------+-----------------------------+-----------+----------+---------
relid | numeric | | |
table_size | bigint | | |
captured_dt | timestamp without time zone | | |
Indexes:
"user_tables_sizes_relid_captured_dt_idx" UNIQUE, btree (relid,
(captured_dt::date))\d pg_class
Table "pg_catalog.pg_class"
Column | Type | Collation | Nullable | Default
---------------------+--------------+-----------+----------+---------
relname | name | | not null |
relnamespace | oid | | not null |
reltype | oid | | not null |
reloftype | oid | | not null |
relowner | oid | | not null |
relam | oid | | not null |
relfilenode | oid | | not null |
reltablespace | oid | | not null |
relpages | integer | | not null |
reltuples | real | | not null |
relallvisible | integer | | not null |
reltoastrelid | oid | | not null |
relhasindex | boolean | | not null |
relisshared | boolean | | not null |
relpersistence | "char" | | not null |
relkind | "char" | | not null |
relnatts | smallint | | not null |
relchecks | smallint | | not null |
relhasoids | boolean | | not null |
relhaspkey | boolean | | not null |
relhasrules | boolean | | not null |
relhastriggers | boolean | | not null |
relhassubclass | boolean | | not null |
relrowsecurity | boolean | | not null |
relforcerowsecurity | boolean | | not null |
relispopulated | boolean | | not null |
relreplident | "char" | | not null |
relispartition | boolean | | not null |
relfrozenxid | xid | | not null |
relminmxid | xid | | not null |
relacl | aclitem[] | | |
reloptions | text[] | | |
relpartbound | pg_node_tree | | |

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-01-15 18:29:45 Re: OID out of range
Previous Message Michael Lewis 2020-01-15 16:51:47 Re: Problem with SqlState=23505 when inserting rows