Re: Information schema sql_identifier

2020-12-23 Thread Adrian Klaver
On 12/22/20 11:21 PM, Laurenz Albe wrote: 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)

Re: Information schema sql_identifier

2020-12-22 Thread Laurenz Albe
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_siz

Re: Information schema sql_identifier

2020-12-22 Thread Adrian Klaver
On 12/22/20 4:39 PM, Tom Lane wrote: Adrian Klaver writes: So how does one go about using a table name from information_schema.tables in pg_table_size()? You want something like select pg_table_size(quote_ident(table_schema)||'.'||quote_ident(table_name)) from information_schema.tables;

Re: Information schema sql_identifier

2020-12-22 Thread Adrian Klaver
On 12/22/20 4:33 PM, David G. Johnston wrote: On Tue, Dec 22, 2020 at 5:08 PM Adrian Klaver > 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 n

Re: Information schema sql_identifier

2020-12-22 Thread Tom Lane
Adrian Klaver writes: > So how does one go about using a table name from > information_schema.tables in pg_table_size()? You want something like select pg_table_size(quote_ident(table_schema)||'.'||quote_ident(table_name)) from information_schema.tables; I imagine that the failures you got a

Re: Information schema sql_identifier

2020-12-22 Thread David G. Johnston
On Tue, Dec 22, 2020 at 5:08 PM Adrian Klaver 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 signatu

Information schema sql_identifier

2020-12-22 Thread Adrian Klaver
Per version 12 release notes: "Treat object-name columns in the information_schema views as being of type name, not varchar (Tom Lane) Per the SQL standard, object-name columns in the information_schema views are declared as being of domain type sql_identifier. In PostgreSQL, the underlying