pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: atp@fastmail.fm
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Syntax incorrect for psql 9.6
Date: Tue, 03 Sep 2019 09:54:29 -0400
Message-ID: <24333.1567518869@sss.pgh.pa.us> (raw)
In-Reply-To: <156748159745.1118.15515709620109809195@wrigleys.postgresql.org>
References: <156748159745.1118.15515709620109809195@wrigleys.postgresql.org>

PG Doc comments form <noreply@postgresql.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





view thread (2+ messages)

Message-ID: <24333.1567518869@sss.pgh.pa.us>
Permalink:  ../24333.1567518869@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24333.1567518869@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, atp@fastmail.fm, pgsql-docs@lists.postgresql.org
  Subject: Re: Syntax incorrect for psql 9.6
  In-Reply-To: <24333.1567518869@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox