Re: Information schema sql_identifier - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Information schema sql_identifier
Date
Msg-id 612fdeaf511c9eca2ccfff50e605461213890604.camel@cybertec.at
Whole thread Raw
In response to Information schema sql_identifier  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Information schema sql_identifier
List pgsql-general
On Tue, 2020-12-22 at 16:07 -0800, Adrian Klaver wrote:
> This came up in this SO question:
> 
> https://stackoverflow.com/questions/65416748/postgres-12-4-gives-function-does-not-exists-error
> 
> Where the query is:
> 
> SELECT (TABLE_SCHEMA || '"."' || TABLE_NAME) as table_name,
>         pg_size_pretty(pg_table_size(table_name)) as table_size,
>         pg_size_pretty(pg_indexes_size(table_name)) AS indexes_size,
>         pg_size_pretty(pg_total_relation_size(table_name)) as total_size
> from information_schema.TABLES nowait
> where TABLE_SCHEMA='myschema'
> order by pg_total_relation_size(table_name) desc;
> 
> And the error is:
> 
> "ERROR:  function pg_table_size(information_schema.sql_identifier) does not exist
> LINE 1: ..."."' || TABLE_NAME) as table_name, pg_size_pretty(pg_table_s..."

I don't see the problem.

Cast "table_name" and "table_schema" to "text" wherever it occurs.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Information schema sql_identifier
Next
From: Lars Vonk
Date:
Subject: Re: Missing rows after migrating from postgres 11 to 12 with logical replication