我正在Mac
使用Monterey
. 当我第一次开始在这台机器上工作时,它的安装Mac M1
有点问题。我搬到了似乎只是底层证券的前沿,所以我认为没有太大变化。homebrew
postgres
GUI
postgres.app
postgres
无论如何,数据库 ( Postgres 12
) 现在正在运行,我发现尝试创建新数据库时出现问题。第三方客户端以及psql
.
rich=# create database sresearch
rich-# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
rich | rich | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
sresearch | rich | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
weather | rich | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
(5 rows)
rich-# \c sresearch
FATAL: no such database: sresearch
由于某种原因无法创建数据库,即使它报告已经这样做了。我不知道为什么会这样,但我想解决它。
我想我可以进行备份并尝试通过删除两个版本来解决此问题,然后返回以homebrew
重新开始Postgres 12
。我不确定如何找出这两个略有不同的版本之间的区别,它们本质上是相同的。
我怎样才能解决这个问题?显然我需要能够制作新的数据库。
更新:我刚刚重新安装了homebrew
版本并尝试导入我的替代postgres.app
导出。它出于某种原因挂断了,\connect <dbname>
但这很容易手动解决。在尝试创建新数据库时,此安装也给了我同样的错误。因此,即使从导出中,两个版本都显示相同。
我不知道该尝试什么。
rich=# \c sres
FATAL: no such database: sres # Indeed there is though
Previous connection kept
rich=#
更新:更多信息 ==>
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
sres | rich | UTF8 | C | C |
sresearch | rich | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(6 rows)
rich=# \c sres;
FATAL: no such database: sres
Previous connection kept
rich=# \s sresearch;
Wrote history to file "sresearch".
rich=#
以下是来自的反馈Sequel
:
更新。甚至更多。==>
rich=# CREATE DATABASE alpha;
CREATE DATABASE
rich=# \c alpha;
FATAL: no such database: alpha
Previous connection kept
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
alpha | rich | UTF8 | C | C |
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(5 rows)
rich=# DROP DATABASE alpha;
DROP DATABASE
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(4 rows)
rich=# CREATE DATABASE alpha;
CREATE DATABASE
rich=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
alpha | rich | UTF8 | C | C |
postgres | rich | UTF8 | C | C |
rich | rich | UTF8 | C | C |
template0 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
template1 | rich | UTF8 | C | C | =c/rich +
| | | | | rich=CTc/rich
(5 rows)
rich=# \c alpha;
FATAL: no such database: alpha
Previous connection kept
rich=#