Re: pg_table_size errors "invalid name syntax" for table names containing spaces

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Michel Helms <michel(at)togetherdb(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_table_size errors "invalid name syntax" for table names containing spaces
Date: 2021-06-10 12:25:04
Message-ID: CAKFQuwb5rTHJ6fcLo8d1jWs3-6=bZ7+mg0U7Z_xJCHTU-cyNEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thursday, June 10, 2021, Michel Helms <michel(at)togetherdb(dot)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.

In response to

Responses

Browse pgsql-bugs by date

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