Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i59GY-0000eL-Eq for pgsql-docs@arkaria.postgresql.org; Tue, 03 Sep 2019 13:54:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i59GW-0007j9-Pq for pgsql-docs@arkaria.postgresql.org; Tue, 03 Sep 2019 13:54:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i59GW-0007gk-HT for pgsql-docs@lists.postgresql.org; Tue, 03 Sep 2019 13:54:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i59GT-0006OE-R5 for pgsql-docs@lists.postgresql.org; Tue, 03 Sep 2019 13:54:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x83DsTLb024334; Tue, 3 Sep 2019 09:54:29 -0400 From: Tom Lane To: atp@fastmail.fm cc: pgsql-docs@lists.postgresql.org Subject: Re: Syntax incorrect for psql 9.6 In-reply-to: <156748159745.1118.15515709620109809195@wrigleys.postgresql.org> References: <156748159745.1118.15515709620109809195@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Tue, 03 Sep 2019 03:33:17 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24332.1567518869.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 03 Sep 2019 09:54:29 -0400 Message-ID: <24333.1567518869@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form 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=3D# \c sonarDB; > You are now connected to database "sonarDB" as user "sonarUser". > sonarDB=3D# REINDEX DATABASE sonarDB; > ERROR: can only reindex the currently open database > sonarDB=3D# 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