我不想安装https://www.pgadmin.org/[pgAdmin] ou phppgadmin 尽管所有内容都在命令行中。
为此,我们必须启动终端并以 postgres 用户身份登录。
postgres 用户是默认情况下唯一有权启动 psql 应用程序的用户,psql 是命令行客户端。 您是专业的翻译。https://fr.wikipedia.org/wiki/Interface_en_ligne_de_commande[命令行界面]) PostgreSQL,
为了能够在终端通过命令行与数据库通信。
要连接,打开终端并输入以下内容:

$ sudo -i -u postgres

要连接并直接进入 PostgreSQL 命令提示符,请输入以下内容:

$ sudo -i -u postgres psql

要列出 PostgreSQL 实例的数据库,以下是命令:

postgres=# \l

结果:

数据库列表 名称 | 所有者 | 编码 | 排序规则 | 字符类型 | 访问权限

fiber | tech | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =Tc/tech
| | | | | tech=CTc/tech fiberdev | tech | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =Tc/tech
| | | | | tech=CTc/tech fiberweb | tech | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =Tc/tech
| | | | | tech=CTc/tech postgres | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | template0 | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =c/postgres
| | | | | postgres=CTc/postgres template1 | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =c/postgres
| | | | | postgres=CTc/postgres (6 行)

按 q 退出结果显示

用于列出 postgresl 实例的模式。

postgres=# SELECT schema_name FROM information_schema.schemata;

结果

公共 information_schema pg_catalog pg_toast_temp_1 pg_temp_1 pg_toast (6 行)

ou

postgres=# SELECT nspname FROM pg_catalog.pg_namespace;

结果

pg_toast pg_temp_1 pg_toast_temp_1 pg_catalog 信息架构 公众 (6 行)

相关文章