vacuumdb has a fatal after database rename - Mailing list pgsql-bugs

From huang
Subject vacuumdb has a fatal after database rename
Date
Msg-id 57EBCBA1.2010700@163.com
Whole thread Raw
Responses Re: vacuumdb has a fatal after database rename  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-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

pgsql-bugs by date:

Previous
From: huang
Date:
Subject: vacuumdb parallel has a deadlock detected in 9.5.4
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: vacuumdb parallel has a deadlock detected in 9.5.4