pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: huang <foggyglass@163.com>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: vacuumdb has a fatal after database rename
Date: Wed, 28 Sep 2016 21:54:41 +0800
Message-ID: <57EBCBA1.2010700@163.com> (raw )
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Hi friends,
If I rename the database postgres before vacuumdb , the vacuumdb say
FATAL: database "postgres" does not exist.
[postgres@vdedu1 ~]$ vacuumdb -a
vacuumdb: vacuuming database "mydb"
vacuumdb: vacuuming database "postgres"
vacuumdb: vacuuming database "template1"
[postgres@vdedu1 ~]$ psql -c"alter database postgres rename to postgresql;"
ERROR: current database cannot be renamed
STATEMENT: alter database postgres rename to postgresql;
ERROR: current database cannot be renamed
[postgres@vdedu1 ~]$ psql
psql (9.5.4)
Type "help" for help.
postgres=# alter database postgres rename to postgresql;
ERROR: current database cannot be renamed
STATEMENT: alter database postgres rename to postgresql;
ERROR: current database cannot be renamed
postgres=# \q
[postgres@vdedu1 ~]$ psql -d template1 -c"alter database postgres rename
to postgresql;"
ALTER DATABASE
[postgres@vdedu1 ~]$ psql -l
FATAL: database "postgres" does not exist
psql: FATAL: database "postgres" does not exist
[postgres@vdedu1 ~]$ psql -l -d template1
List of databases
Name | Owner | Encoding | Collate | Ctype | Access
privile
ges
------------+----------+----------+-------------+-------------+-----------------
------
mydb | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgresql | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
=c/postgres
+
| | | | |
postgres=CTc/pos
tgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
=c/postgres
+
| | | | |
postgres=CTc/pos
tgres
(4 rows)
[postgres@vdedu1 ~]$ vacuumdb -a
FATAL: database "postgres" does not exist
vacuumdb: vacuuming database "mydb"
vacuumdb: vacuuming database "postgresql"
vacuumdb: vacuuming database "template1"
[postgres@vdedu1 ~]$
2016-09-28
TT
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
view thread (3+ messages) latest in thread
Message-ID: <57EBCBA1.2010700@163.com>
Permalink: ../57EBCBA1.2010700@163.com/
Also on: postgresql.org/message-id/57EBCBA1.2010700@163.com
copy link · copy postgr.es
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: foggyglass@163.com
Subject: Re: vacuumdb has a fatal after database rename
In-Reply-To: <57EBCBA1.2010700@163.com>
References: <57EBCBA1.2010700@163.com>
* 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