【问题标题】:psql: database "template0" is not currently accepting connectionspsql:数据库“template0”当前不接受连接
【发布时间】:2017-03-24 17:01:40
【问题描述】:

我们已经安装了新的 gpdb 数据库。但是,当尝试连接 template0 数据库时。

[gpadmin@mdw~]$ psql -d template0
psql: FATAL:  database "template0" is not currently accepting connections
[gpadmin@mdw~]$ 

我们尝试更新 FLAG

template1=# UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
ERROR:  permission denied: "pg_database" is a system catalog
template1=# 

但是,它不允许更新 FLAG

【问题讨论】:

  • 为什么你认为你需要连接到template0?该数据库出于某种原因不允许连接。
  • 知道了。我将使用 template1

标签: greenplum hawq


【解决方案1】:

没有理由连接到 template0。甚至 template1 也不应该使用,因为这是新创建的数据库的默认模板。如果您在 template1 中创建某些内容,它将被复制到任何新数据库中。如果你使用template1连接数据库,然后忘记切换数据库,这很容易忘记。

您可以使用 postgres 数据库进行连接。否则不会使用那个。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-03-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-31
  • 2017-08-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多