Re: Syntax incorrect for psql 9.6

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: atp(at)fastmail(dot)fm
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Syntax incorrect for psql 9.6
Date: 2019-09-03 13:54:29
Message-ID: 24333.1567518869@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

PG Doc comments form <noreply(at)postgresql(dot)org> writes:
> For the REINDEX DATABASE command, the documentation suggests REINDEX
> DATABASE databaseName, however my experience suggests this does not work;
> the database name must be quoted:

> sonarDB=# \c sonarDB;
> You are now connected to database "sonarDB" as user "sonarUser".
> sonarDB=# REINDEX DATABASE sonarDB;
> ERROR: can only reindex the currently open database
> sonarDB=# REINDEX DATABASE "sonarDB";
> REINDEX

There's nothing wrong with REINDEX; this is just the generic problem
that non-lower-case identifiers have to be double-quoted anywhere
in SQL. See

https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

particularly the last para in 4.1.1.

regards, tom lane

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Andres Freund 2019-09-04 09:40:55 Re: Release notes on "reserved OIDs"
Previous Message Michael Paquier 2019-09-03 04:07:17 Re: kilobyte unit spelled "K bytes"