aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2024-07-29 11:34:12 -0500
committerNathan Bossart <nathan@postgresql.org>2024-07-29 11:34:12 -0500
commit5c1ce1bbbe5fb8ac2fb1725a980caeed64d7a33e (patch)
tree2ba26182a518c0728c725056a7968754ae8998bc
parent0f129052150487afab9fe64889c5bf7534f7bbc3 (diff)
downloadpostgresql-5c1ce1bbbe5fb8ac2fb1725a980caeed64d7a33e.tar.gz
postgresql-5c1ce1bbbe5fb8ac2fb1725a980caeed64d7a33e.zip
Remove tab completion for CREATE UNLOGGED MATERIALIZED VIEW.
Commit 3bf3ab8c56 added support for unlogged materialized views, but commit 3223b25ff7 reverted that feature before it made it into a release. However, the latter commit left the grammar and tab-completion support intact. This commit removes the tab-completion support to prevent psql from recommending bogus commands. I've opted to keep the grammar support so that the server continues to emit a descriptive error when users try to create unlogged matviews. Reported-by: Daniel Westermann, px shi Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/ZR0P278MB092093E92263DE16734208A5D2C59%40ZR0P278MB0920.CHEP278.PROD.OUTLOOK.COM Discussion: https://postgr.es/m/CAAccyY%2BWg1Z-9tNfSwLmuZVgGOwqU5u1OP-RWcoAr2UZGuvN_w%40mail.gmail.com
-rw-r--r--src/bin/psql/tab-complete.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 891face1b65..024469474da 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3267,15 +3267,9 @@ psql_completion(const char *text, int start, int end)
/* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */
else if (TailMatches("CREATE", "TEMP|TEMPORARY"))
COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW");
- /* Complete "CREATE UNLOGGED" with TABLE, SEQUENCE or MATVIEW */
+ /* Complete "CREATE UNLOGGED" with TABLE or SEQUENCE */
else if (TailMatches("CREATE", "UNLOGGED"))
- {
- /* but not MATVIEW in CREATE SCHEMA */
- if (HeadMatches("CREATE", "SCHEMA"))
- COMPLETE_WITH("TABLE", "SEQUENCE");
- else
- COMPLETE_WITH("TABLE", "SEQUENCE", "MATERIALIZED VIEW");
- }
+ COMPLETE_WITH("TABLE", "SEQUENCE");
/* Complete PARTITION BY with RANGE ( or LIST ( or ... */
else if (TailMatches("PARTITION", "BY"))
COMPLETE_WITH("RANGE (", "LIST (", "HASH (");