Re: OID out of range

From: bhargav kamineni <bhargavpostgres(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Konireddy Rajashekar <rajkonireddy(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: OID out of range
Date: 2020-01-15 18:36:39
Message-ID: CADCf-WP1PHWEpmvaAMyRszFEa8SbRtaBYbtGuwmW+hEEzDNhYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Any workaround to make it work ?

On Thu, 16 Jan 2020 at 00:00, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> 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(dot)klaver(at)aklaver(dot)com
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2020-01-15 18:42:25 Re: OID out of range
Previous Message Adrian Klaver 2020-01-15 18:29:45 Re: OID out of range