From: | Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> |
---|---|
To: | Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | tab complete changes |
Date: | 2007-08-25 11:33:26 |
Message-ID: | 46D01386.9070702@kaltenbrunner.cc |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
the attached patch makes teh following changes to the psql tab-complete
support
* adds a few missing words to some commands (like adding GIN as a valid
index type or OWNED BY for ALTER SEQUENCE,...)
* support for ALTER TABLE foo ENABLE/DISABLE REPLICA TRIGGER/RULE
* autocomplete CREATE DATABASE foo TEMPLATE (mostly done to prevent
conflicts with the TEMPLATE keyword for text search)
* support for ALTER/CREATE/DROP TEXT SEARCH as well as COMMENT ON TEXT
SEARCH and the corresponding psql backslash commands.
This proved a little more difficult than expected due to the fact that
words_after_create[] is used for two purposes - one is to provide a list
of words that follow immediatly after CREATE (or DROP) and the other
purpose is to use it for autocompleting anywhere in the statement if the
word in that struct is found with a query.
Since TEXT SEARCH CONFIGURATION|DICTIONARY|TEMPLATE|PARSER results in 3
words instead of one (as all the other words in that list are) I added a
flag to the struct to tell create_command_generator() to skip that entry
for autocompleting immediatly after CREATE which feels like a dirty
hack (but that holds true for a lot of code in tab-complete.c).
Stefan
Attachment | Content-Type | Size |
---|---|---|
patch_tabcomplete2.diff | text/plain | 19.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Dawid Kuroczko | 2007-08-25 17:22:13 | LDAP service lookup |
Previous Message | Tom Lane | 2007-08-25 00:05:43 | Re: Bunch of tsearch fixes and cleanup |