pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
vacuumdb has a fatal after database rename
3+ messages / 2 participants
[nested] [flat]

* vacuumdb has a fatal after database rename
@ 2016-09-28 13:54 huang <foggyglass@163.com>
  2016-09-28 17:29 ` Re: vacuumdb has a fatal after database rename hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 3+ messages in thread

From: huang @ 2016-09-28 13:54 UTC (permalink / raw)
  To: 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



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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: vacuumdb has a fatal after database rename
  2016-09-28 13:54 vacuumdb has a fatal after database rename huang <foggyglass@163.com>
@ 2016-09-28 17:29 ` hubert depesz lubaczewski <depesz@depesz.com>
  2016-09-29 14:05   ` Re: vacuumdb has a fatal after database rename huang <foggyglass@163.com>
  0 siblings, 1 reply; 3+ messages in thread

From: hubert depesz lubaczewski @ 2016-09-28 17:29 UTC (permalink / raw)
  To: huang <foggyglass@163.com>; +Cc: pgsql-bugs

On Wed, Sep 28, 2016 at 09:54:41PM +0800, huang wrote:
> If I rename the database postgres  before vacuumdb , the vacuumdb say
> FATAL:  database "postgres" does not exist.

So don't rename it. It's being used because you are running vacuumdb
using postgres shell account.

You could try something like:

PGDATABASE=template1 vacuumdb -az

but generally speaking it is not advised to rename postgres db.

Best regards,

depesz



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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: vacuumdb has a fatal after database rename
  2016-09-28 13:54 vacuumdb has a fatal after database rename huang <foggyglass@163.com>
  2016-09-28 17:29 ` Re: vacuumdb has a fatal after database rename hubert depesz lubaczewski <depesz@depesz.com>
@ 2016-09-29 14:05   ` huang <foggyglass@163.com>
  0 siblings, 0 replies; 3+ messages in thread

From: huang @ 2016-09-29 14:05 UTC (permalink / raw)
  To: depesz@depesz.com; +Cc: pgsql-bugs



I am sorry . 
we want to hide the database postgres for  the security concern . 
However I found this message in log . 
I think there are some problem in vacuumdb .
But  now I see  this is my mistake .  


Best regards,
TT


At 2016-09-29 01:29:37, "hubert depesz lubaczewski" <depesz@depesz.com> wrote:
>On Wed, Sep 28, 2016 at 09:54:41PM +0800, huang wrote:
>> If I rename the database postgres  before vacuumdb , the vacuumdb say
>> FATAL:  database "postgres" does not exist.
>
>So don't rename it. It's being used because you are running vacuumdb
>using postgres shell account.
>
>You could try something like:
>
>PGDATABASE=template1 vacuumdb -az
>
>but generally speaking it is not advised to rename postgres db.
>
>Best regards,
>
>depesz
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-09-29 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 13:54 vacuumdb has a fatal after database rename huang <foggyglass@163.com>
2016-09-28 17:29 ` hubert depesz lubaczewski <depesz@depesz.com>
2016-09-29 14:05   ` huang <foggyglass@163.com>

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