pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Information schema sql_identifier
Date: Tue, 22 Dec 2020 17:03:38 -0800
Message-ID: <16a428e1-2535-e67e-1510-0ad0fc61ae8d@aklaver.com> (raw)
In-Reply-To: <CAKFQuwbu2cHBEEyS_NBhXFouXAjPcMzG3iw5q7iJqudCaA+GQQ@mail.gmail.com>
References: <653c81a9-bc2b-e7a6-1ece-eab59f007400@aklaver.com>
	<CAKFQuwbu2cHBEEyS_NBhXFouXAjPcMzG3iw5q7iJqudCaA+GQQ@mail.gmail.com>

On 12/22/20 4:33 PM, David G. Johnston wrote:
> On Tue, Dec 22, 2020 at 5:08 PM Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.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.klaver@aklaver.com





view thread (7+ messages)  latest in thread

Message-ID: <16a428e1-2535-e67e-1510-0ad0fc61ae8d@aklaver.com>
Permalink:  ../16a428e1-2535-e67e-1510-0ad0fc61ae8d@aklaver.com/
Also on:    postgresql.org/message-id/16a428e1-2535-e67e-1510-0ad0fc61ae8d@aklaver.com

 · 

reply

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, david.g.johnston@gmail.com
  Subject: Re: Information schema sql_identifier
  In-Reply-To: <16a428e1-2535-e67e-1510-0ad0fc61ae8d@aklaver.com>
  References: <653c81a9-bc2b-e7a6-1ece-eab59f007400@aklaver.com> <CAKFQuwbu2cHBEEyS_NBhXFouXAjPcMzG3iw5q7iJqudCaA+GQQ@mail.gmail.com> <16a428e1-2535-e67e-1510-0ad0fc61ae8d@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