On Fri, Nov 30, 2018 at 03:44:38PM +0000, Dagfinn Ilmari Mannsåker wrote:
> ilm...@ilmari.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

Attachment: signature.asc
Description: PGP signature

Reply via email to