vacuumdb has a fatal after database rename

From: huang <foggyglass(at)163(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: vacuumdb has a fatal after database rename
Date: 2016-09-28 13:54:41
Message-ID: 57EBCBA1.2010700@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi friends,

If I rename the database postgres before vacuumdb , the vacuumdb say
FATAL: database "postgres" does not exist.

[postgres(at)vdedu1 ~]$ vacuumdb -a
vacuumdb: vacuuming database "mydb"
vacuumdb: vacuuming database "postgres"
vacuumdb: vacuuming database "template1"
[postgres(at)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(at)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(at)vdedu1 ~]$ psql -d template1 -c"alter database postgres rename
to postgresql;"
ALTER DATABASE
[postgres(at)vdedu1 ~]$ psql -l
FATAL: database "postgres" does not exist
psql: FATAL: database "postgres" does not exist
[postgres(at)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(at)vdedu1 ~]$ vacuumdb -a
FATAL: database "postgres" does not exist
vacuumdb: vacuuming database "mydb"
vacuumdb: vacuuming database "postgresql"
vacuumdb: vacuuming database "template1"
[postgres(at)vdedu1 ~]$

2016-09-28
TT

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hubert depesz lubaczewski 2016-09-28 17:25:51 Re: vacuumdb parallel has a deadlock detected in 9.5.4
Previous Message huang 2016-09-28 13:46:22 vacuumdb parallel has a deadlock detected in 9.5.4