Postgresql autocomplete?
You might like pgcli which provide completion for join and other nice features. However, it lacks some \*
helpers like \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 CASCADEReferenced by: TABLE "vin" CONSTRAINT "vin_appellation_id_fkey" FOREIGN KEY (appellation_id) REFERENCES appellation(id) ON DELETE CASCADETime: 0.006scave> SELECT * FROM appellation JOIN _ region ON region.id = appellation.region_id join vin ON vin.appellation_id = appellation.id join
In this example two joins are proposed corresponding to foreign keys.
Simple answer below:
I spent a long time trying to get tab-complete to work on the psql client AND the SQL shell (psql) client. Here's what you do.
Stop trying and use the client found here: pgcli
I installed using pip, opened the client using >pgcli -Upostgres
, and entered the same password created with I installed Postgresql. Tab-completion works and I'm good to go.