Re: [PATCH] Improve tab completion for CREATE TABLE

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Improve tab completion for CREATE TABLE
Date: 2018-12-19 05:05:30
Message-ID: 20181219050530.GC19856@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 30, 2018 at 03:44:38PM +0000, Dagfinn Ilmari Mannsåker wrote:
> ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker) writes:
>> Please find attached a patch that adds the following tab completions for
>> CREATE TABLE:
>
> Added to the 2019-01 commitfest: https://commitfest.postgresql.org/21/1895/

+ else if (TailMatches("CREATE", "TABLE", MatchAny) ||
+ TailMatches("CREATE", "TEMP|TEMPORARY|UNLOGGED", "TABLE", MatchAny))
+ COMPLETE_WITH("(", "PARTITION OF");
This is missing the completion of "OF TYPE" (no need to print the type
matches).

+ else if (TailMatches("CREATE", "TABLE", MatchAny, "(*)") ||
+ TailMatches("CREATE", "UNLOGGED", "TABLE", MatchAny, "(*)"))
+ COMPLETE_WITH("INHERITS (", "PARTITION BY", "WITH (", "TABLESPACE")
Temporary tables can be part of a partition tree, with the parent being
temporary or permanent.

+ /* Complete ON COMMIT actions for temp tables */
+ else if (TailMatches("ON", "COMMIT"))
+ COMPLETE_WITH("PRESERVE ROWS", "DELETE ROWS", "DROP");
This causes ON COMMIT to show up for permanent and unlogged tables.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-12-19 05:27:05 Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS
Previous Message Michael Paquier 2018-12-19 04:53:28 Re: pg_dumpall --exclude-database option