BUG #8394: SQL command REINDEX doesn't work

Started by Yong Zhangover 12 years ago5 messagesbugs
Jump to latest
#1Yong Zhang
yzhang@trinityusa.com

The following bug has been logged on the website:

Bug reference: 8394
Logged by: Yz Primus
Email address: yzhang@trinityusa.com
PostgreSQL version: 9.1.3
Operating system: Windows 7 64-bit
Description:

I always received error when trying to run SQL command REINDEX either from
pgAdmin III or psql. If I ran REINDEX DATABASE it threw error:
ERROR: syntax error at end of input
LINE 1: REINDEX DATABASE

If I ran REINDEX DATABASE mydb it threw error:
ERROR: can only reindex the currently open database

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Thomas Kellerer
spam_eater@gmx.net
In reply to: Yong Zhang (#1)
Re: BUG #8394: SQL command REINDEX doesn't work

yzhang@trinityusa.com wrote on 23.08.2013 18:00:

The following bug has been logged on the website:

Bug reference: 8394
Logged by: Yz Primus
Email address: yzhang@trinityusa.com
PostgreSQL version: 9.1.3
Operating system: Windows 7 64-bit
Description:

I always received error when trying to run SQL command REINDEX either from
pgAdmin III or psql. If I ran REINDEX DATABASE it threw error:
ERROR: syntax error at end of input
LINE 1: REINDEX DATABASE

If I ran REINDEX DATABASE mydb it threw error:
ERROR: can only reindex the currently open database

Quote from the manual:

Presently, REINDEX DATABASE and REINDEX SYSTEM can only reindex the current database,
so their parameter must match the current database's name.

So you need to specify the name of the current database even though it's not really needed.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Yong Zhang
yzhang@trinityusa.com
In reply to: Thomas Kellerer (#2)
Re: BUG #8394: SQL command REINDEX doesn't work

Thanks for the prompt response. But that's what I tried and it didn't work. I tried following command in both pgAdmin III and psql:

REINDEX DATABASE PremierIEX

Then I got error

ERROR: can only reindex the currently open database

PremierIEX is my current database. In pgAdmin III it threw extra info:

SQL state: 0A000

Thanks,

Yong

-----Original Message-----
From: Thomas Kellerer [mailto:spam_eater@gmx.net]
Sent: Friday, August 23, 2013 3:13 PM
To: Yong Zhang
Cc: Yong Zhang
Subject: Re: BUG #8394: SQL command REINDEX doesn't work

yzhang@trinityusa.com <mailto:yzhang@trinityusa.com> wrote on 23.08.2013 18:00:

The following bug has been logged on the website:

Bug reference: 8394

Logged by: Yz Primus

Email address: yzhang@trinityusa.com <mailto:yzhang@trinityusa.com>

PostgreSQL version: 9.1.3

Operating system: Windows 7 64-bit

Description:

I always received error when trying to run SQL command REINDEX either

from pgAdmin III or psql. If I ran REINDEX DATABASE it threw error:

ERROR: syntax error at end of input

LINE 1: REINDEX DATABASE

If I ran REINDEX DATABASE mydb it threw error:

ERROR: can only reindex the currently open database

Quote from the manual:

Presently, REINDEX DATABASE and REINDEX SYSTEM can only reindex the current database,

so their parameter must match the current database's name.

So you need to specify the name of the current database even though it's not really needed.

#4Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Yong Zhang (#3)
Re: BUG #8394: SQL command REINDEX doesn't work

On Fri, Aug 23, 2013 at 3:39 PM, Yong Zhang <yzhang@trinityusa.com> wrote:

Thanks for the prompt response. But that's what I tried and it didn't work.
I tried following command in both pgAdmin III and psql:

REINDEX DATABASE PremierIEX

If that is the name of the database, then it probably is because of
the uppercase letters. Try this way:

REINDEX DATABASE "PremierIEX"

--
Jaime Casanova www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566 Cell: +593 987171157

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#5Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Jaime Casanova (#4)
Re: BUG #8394: SQL command REINDEX doesn't work

Jaime Casanova <jaime@2ndquadrant.com> wrote:

If that is the name of the database, then it probably is because
of the uppercase letters. Try this way:

REINDEX DATABASE "PremierIEX"

Some command shells will eat the quotes when done like that.  It
may be necessary to use this style of quoting:

REINDEX DATABASE '"PremierIEX"'

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs