Re: Information schema sql_identifier

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Information schema sql_identifier
Date: 2020-12-23 01:03:38
Message-ID: 16a428e1-2535-e67e-1510-0ad0fc61ae8d@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/22/20 4:33 PM, David G. Johnston wrote:
> On Tue, Dec 22, 2020 at 5:08 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
> SELECT pg_table_size(table_name::regclass)  from
> information_schema.tables;
> ERROR:  invalid name syntax
>
> So how does one go about using a table name from
> information_schema.tables in pg_table_size()?
>
>
> Find that the function signature in the documentation requires an input
> of "regclass" and ignore attempts to pass anything but that to the function.
>
> pg_table_size ( regclass ) → bigint
>
> I observe in v13 that the expected syntax works just fine:
>
> select pg_table_size((table_schema || '.' || table_name)::regclass) from
> information_schema.tables;

Yeah I tried that, didn't include in my previous post:

select pg_table_size((table_schema || '.' || table_name)::regclass) from
information_schema.tables;
ERROR: invalid name syntax

>
> David J.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-12-23 01:22:42 Re: Information schema sql_identifier
Previous Message Tom Lane 2020-12-23 00:39:22 Re: Information schema sql_identifier