From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Konireddy Rajashekar <rajkonireddy@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: OID out of range
Date: Wed, 15 Jan 2020 10:29:45 -0800
Message-ID: <aaa6b3e0-7fe6-9736-b044-0873dcd4fb2d@aklaver.com> (raw)
In-Reply-To: <CAGpkkhtm8XOa2J9NBuRkSiXoR0ipimvQiFdd+wKpd7XBeayFpw@mail.gmail.com>
References: <CAGpkkhtm8XOa2J9NBuRkSiXoR0ipimvQiFdd+wKpd7XBeayFpw@mail.gmail.com>
On 1/15/20 10:18 AM, Konireddy Rajashekar wrote:
> 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
Given this:
https://www.postgresql.org/docs/12/datatype-oid.html
"The oid type is currently implemented as an unsigned four-byte integer. "
I am pretty sure this:
c.oid::bigint
is the problem.
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, rajkonireddy@gmail.com
Subject: Re: OID out of range
In-Reply-To: <aaa6b3e0-7fe6-9736-b044-0873dcd4fb2d@aklaver.com>
References: <CAGpkkhtm8XOa2J9NBuRkSiXoR0ipimvQiFdd+wKpd7XBeayFpw@mail.gmail.com> <aaa6b3e0-7fe6-9736-b044-0873dcd4fb2d@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox