Postgresql自动完成?

phi*_*wei 12 postgresql autocomplete

有什么能为PostgreSQL提供自动完成功能吗?我正在寻找类似于RedGate的SQLPrompt的东西.目前使用pgAdmin III的查询工具但愿意考虑其他查询编辑器.

Dav*_*ith 11

psql有它.我在服务器版本8.2.6上使用的是8.2.7版

  • 傻我.我从来没有停下来打ctrl + space. (3认同)

Éti*_*sac 7

您可能喜欢pgcli,它提供了连接完成和其他不错的功能。然而,它缺少一些\*\dF....

cave> \d appellation
+-----------+---------+-----------------------------------------------------------+
| Column    | Type    | Modifiers                                                 |
|-----------+---------+-----------------------------------------------------------|
| id        | integer |  not null default nextval('appellation_id_seq'::regclass) |
| libelle   | text    |  not null                                                 |
| region_id | integer |                                                           |
+-----------+---------+-----------------------------------------------------------+
Indexes:
    "appellation_pkey" PRIMARY KEY, btree (id)
    "appellation_libelle_key" UNIQUE CONSTRAINT, btree (libelle)
Foreign-key constraints:
    "appellation_region_id_fkey" FOREIGN KEY (region_id) REFERENCES region(id) ON DELETE CASCADE
Referenced by:
    TABLE "vin" CONSTRAINT "vin_appellation_id_fkey" FOREIGN KEY (appellation_id) REFERENCES appellation(id) ON DELETE CASCADE

Time: 0.006s
cave> SELECT * FROM appellation JOIN  _
                                      region ON region.id = appellation.region_id     join      
                                      vin ON vin.appellation_id = appellation.id      join      
Run Code Online (Sandbox Code Playgroud)

在此示例中,提出了与外键相对应的两个连接。


小智 5

简单回答如下:

我花了很长时间尝试让制表符完成在 psql 客户端和 SQL shell (psql) 客户端上工作。这就是你要做的。

停止尝试并使用此处找到的客户端:pgcli

我使用 pip 安装,使用 打开客户端>pgcli -Upostgres,并输入与安装 Postgresql 时创建的相同密码。制表符补全功能有效,我可以开始了。