Applied v3 patch to master and verified it with below commands,

#Alter view

postgres=# alter view v <tab>
ALTER COLUMN  OWNER TO      RENAME        RESET (       SET

postgres=# alter view v set <tab>
(       SCHEMA

postgres=# alter view v set ( <tab>
CHECK_OPTION      SECURITY_BARRIER  SECURITY_INVOKER

postgres=# alter view v reset ( <tab>
CHECK_OPTION      SECURITY_BARRIER  SECURITY_INVOKER

postgres=# alter view v set ( check_option = <tab>
CASCADED  LOCAL

postgres=# alter view v set ( security_barrier = <tab>
FALSE  TRUE

postgres=# alter view v set ( security_invoker = <tab>
FALSE  TRUE


#Create view

postgres=# create view v
AS      WITH (
postgres=# create or replace view v
AS      WITH (

postgres=# create view v with (
CHECK_OPTION      SECURITY_BARRIER  SECURITY_INVOKER

postgres=# create or replace view v with (
CHECK_OPTION      SECURITY_BARRIER  SECURITY_INVOKER

postgres=# create view v with (*)<tab>AS
postgres=# create or replace view v with (*)<tab>AS

postgres=# create view v as <tab>SELECT
postgres=# create or replace view v as <tab>SELECT


For below changes,

     else if (TailMatches("CREATE", "VIEW", MatchAny, "AS") ||
-             TailMatches("CREATE", "OR", "REPLACE", "VIEW", MatchAny, "AS")) +             TailMatches("CREATE", "VIEW", MatchAny, "WITH", "(*)", "AS") || +             TailMatches("CREATE", "OR", "REPLACE", "VIEW", MatchAny, "AS") || +             TailMatches("CREATE", "OR", "REPLACE", "VIEW", MatchAny, "WITH", "(*)", "AS"))

it would be great to switch the order of the 3rd and the 4th line to make a better match for "CREATE" and "CREATE OR REPLACE" .


Since it supports <tab> in the middle for below case,
postgres=# alter view v set ( security_<tab>
security_barrier  security_invoker

and during view reset it can also provide all the options list,
postgres=# alter view v reset (
CHECK_OPTION      SECURITY_BARRIER  SECURITY_INVOKER

but not sure if it is a good idea or possible to autocomplete the reset options after seeing one of the options showing up with "," for example,
postgres=# alter view v reset ( CHECK_OPTION, <tab>
SECURITY_BARRIER  SECURITY_INVOKER


Thank you,

David



Reply via email to