Re: pg_table_size errors "invalid name syntax" for table names containing spaces - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: pg_table_size errors "invalid name syntax" for table names containing spaces
Date
Msg-id CAKFQuwb5rTHJ6fcLo8d1jWs3-6=bZ7+mg0U7Z_xJCHTU-cyNEw@mail.gmail.com
Whole thread Raw
In response to pg_table_size errors "invalid name syntax" for table names containing spaces  (Michel Helms <michel@togetherdb.com>)
Responses Re: pg_table_size errors "invalid name syntax" for table names containing spaces  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs


On Thursday, June 10, 2021, Michel Helms <michel@togetherdb.com> wrote:

CREATE TABLE "wei rd" (id SERIAL);
SELECT pg_table_size('wei rd');

So just creating a table containing spaces, the pg_table_size, also pg_total_relation_size and maybe other administrative functions fail with error message "invalid name syntax".

You still have to double-quote the name even if its being passed around in a string literal.

David J.
 

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17055: Logical replication worker crashes when applying update of row that dose not exist in target partiti
Next
From: Tom Lane
Date:
Subject: Re: pg_table_size errors "invalid name syntax" for table names containing spaces