psql: tab completion differs on semicolon placement

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: psql: tab completion differs on semicolon placement
Date: 2021-09-20 13:06:17
Message-ID: 44786457-3E92-4162-9AFC-1E0328792BF6@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While testing a patch I fat-fingered a CREATE DATABASE statement by tab
completing *after* the semicolon, with no space between the objname and
semicolon. The below options were presented, which at this point aren't really
applicable:

db=# create database foo;
ALLOW_CONNECTIONS ENCODING LC_COLLATE LOCALE TABLESPACE
CONNECTION LIMIT IS_TEMPLATE LC_CTYPE OWNER TEMPLATE

DROP DATABASE has a similar tab completion which makes about as much sense:

db=# drop database foo;WITH (

Checking prev_wd for not ending with ';' as per the attached makes "objname;"
behave like "objname ;". Is there a reason for not doing that which I'm
missing? I didn't check for others, but if this seems reasonable I'll go
through to find any other similar cases.

--
Daniel Gustafsson https://vmware.com/

Attachment Content-Type Size
psql_createdb-tabcomplete.diff application/octet-stream 1008 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-09-20 13:18:15 Re: Timeout failure in 019_replslot_limit.pl
Previous Message Alvaro Herrera 2021-09-20 12:38:29 Re: Timeout failure in 019_replslot_limit.pl