Re: pgstattuple does not work with uppercase table names

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: andreas(dot)eriksson(at)griffeye(dot)com
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pgstattuple does not work with uppercase table names
Date: 2018-11-02 18:15:32
Message-ID: CABUevEyVSnZWzgdziXPdThL6G8BU3sMy8uEgUob_t5cDFh6BQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Nov 2, 2018 at 11:56 AM Andreas Eriksson <
andreas(dot)eriksson(at)griffeye(dot)com> wrote:

> Thanks,
>
>
>
> Could it be helpful to explain this in the user manual?
>

(please avoid top-posting)

It's documented at
https://www.postgresql.org/docs/11/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS,
as it's a pretty fundamental part of SQL. We definitely could move it to a
more prominent place, but it would make little sense to document it
individually for every place that uses one I think.

//Magnus

>
> *From:* Magnus Hagander <magnus(at)hagander(dot)net>
> *Sent:* den 2 november 2018 11:55
> *To:* Andreas Eriksson <andreas(dot)eriksson(at)griffeye(dot)com>
> *Cc:* pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
> *Subject:* Re: pgstattuple does not work with uppercase table names
>
>
>
>
>
> On Fri, Nov 2, 2018 at 11:51 AM Andreas Eriksson <
> andreas(dot)eriksson(at)griffeye(dot)com> wrote:
>
> Steps to reproduce:
>
> CREATE EXTENSION pgstattuple;
>
> CREATE TABLE "Test" AS SELECT * FROM generate_series(1, 10000);
>
> SELECT * FROM pgstattuple('Test');
>
>
>
> ERROR: relation "test" does not exist SQL state: 42P01
>
>
>
>
>
> You need to quote the identifier:
>
> SELECT * FROM pgstattuple('"Test"');
>
>
>
> Note the double quotes inside the string, so
> "singlequote-doublequote-Test-doublequote-singlequote".
>
>
>
> --
>
> Magnus Hagander
> Me: https://www.hagander.net/ <http://www.hagander.net/>
> Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
>
>
> *Andreas Eriksson *Principal Software Engineer, Software Architect
> Tel: +46 31 719 08 00
> Mobile: +46 739 07 41 79
> andreas(dot)eriksson(at)griffeye(dot)com
>
> [image: Griffeye]
>
>
> *Griffeye Technologies AB *Första Långgatan 30, SE-413 27 Göteborg, Sweden
> griffeye.com <https://www.griffeye.com>
>
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alistair Johnson 2018-11-02 18:46:44 Unable to copy large (>2GB) files using PostgreSQL 11 (Windows)
Previous Message Andrew Gierth 2018-11-02 17:34:43 Re: Wrong aggregate result when sorting by a NULL value