pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
8+ messages / 2 participants
[nested] [flat]
* pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
@ 2016-12-24 02:02 Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 02:02 UTC (permalink / raw)
To: pgsql-committers
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we are
including the list of roles as possible options for completion after the
GRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same time
and in either order, but the tab completion was only working for one or
the other. Lastly, we weren't using the actual list of allowed kinds of
objects for default privileges for completion after the 'GRANT X ON' but
instead were completeing to what 'GRANT X ON' supports, which isn't the
ssame at all.
Address these issues by improving the forward tab-completion for ALTER
DEFAULT PRIVILEGES and then constrain and correct how the tail
completion is done when it is for ALTER DEFAULT PRIVILEGES.
Back-patch the forward/tail tab-completion to 9.6, where we made it easy
to handle such cases.
For 9.5 and earlier, correct the initial tab-completion to at least be
correct as far as it goes and then add a check for GRANT/REVOKE to only
tab-complete when the GRANT/REVOKE is the start of the command, so we
don't try to do tab-completion after we get to the GRANT/REVOKE part of
the ALTER DEFAULT PRIVILEGES command, which is better than providing
incorrect completions.
Initial patch for master and 9.6 by Gilles Darold, though I cleaned it
up and added a few comments. All bugs in the 9.5 and earlier patch are
mine.
Discussion: https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/f3fd531a51df2a73d8517a542e6999e0186e586b
Modified Files
--------------
src/bin/psql/tab-complete.c | 57 ++++++++++++++++++++++++++++++++++++++-------
1 file changed, 48 insertions(+), 9 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
* pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
@ 2016-12-24 02:02 Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 02:02 UTC (permalink / raw)
To: pgsql-committers
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we are
including the list of roles as possible options for completion after the
GRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same time
and in either order, but the tab completion was only working for one or
the other. Lastly, we weren't using the actual list of allowed kinds of
objects for default privileges for completion after the 'GRANT X ON' but
instead were completeing to what 'GRANT X ON' supports, which isn't the
ssame at all.
Address these issues by improving the forward tab-completion for ALTER
DEFAULT PRIVILEGES and then constrain and correct how the tail
completion is done when it is for ALTER DEFAULT PRIVILEGES.
Back-patch the forward/tail tab-completion to 9.6, where we made it easy
to handle such cases.
For 9.5 and earlier, correct the initial tab-completion to at least be
correct as far as it goes and then add a check for GRANT/REVOKE to only
tab-complete when the GRANT/REVOKE is the start of the command, so we
don't try to do tab-completion after we get to the GRANT/REVOKE part of
the ALTER DEFAULT PRIVILEGES command, which is better than providing
incorrect completions.
Initial patch for master and 9.6 by Gilles Darold, though I cleaned it
up and added a few comments. All bugs in the 9.5 and earlier patch are
mine.
Discussion: https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com
Branch
------
REL9_6_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/dc61580bd9a6ad869478c9e6f7ba76cb6314f864
Modified Files
--------------
src/bin/psql/tab-complete.c | 57 ++++++++++++++++++++++++++++++++++++++-------
1 file changed, 48 insertions(+), 9 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
* pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
@ 2016-12-24 02:02 Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 02:02 UTC (permalink / raw)
To: pgsql-committers
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we are
including the list of roles as possible options for completion after the
GRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same time
and in either order, but the tab completion was only working for one or
the other. Lastly, we weren't using the actual list of allowed kinds of
objects for default privileges for completion after the 'GRANT X ON' but
instead were completeing to what 'GRANT X ON' supports, which isn't the
ssame at all.
Address these issues by improving the forward tab-completion for ALTER
DEFAULT PRIVILEGES and then constrain and correct how the tail
completion is done when it is for ALTER DEFAULT PRIVILEGES.
Back-patch the forward/tail tab-completion to 9.6, where we made it easy
to handle such cases.
For 9.5 and earlier, correct the initial tab-completion to at least be
correct as far as it goes and then add a check for GRANT/REVOKE to only
tab-complete when the GRANT/REVOKE is the start of the command, so we
don't try to do tab-completion after we get to the GRANT/REVOKE part of
the ALTER DEFAULT PRIVILEGES command, which is better than providing
incorrect completions.
Initial patch for master and 9.6 by Gilles Darold, though I cleaned it
up and added a few comments. All bugs in the 9.5 and earlier patch are
mine.
Discussion: https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com
Branch
------
REL9_5_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/16a2efdb28dfdbf705fcf7b95c981847cad7234d
Modified Files
--------------
src/bin/psql/tab-complete.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
* pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
@ 2016-12-24 02:02 Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 02:02 UTC (permalink / raw)
To: pgsql-committers
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we are
including the list of roles as possible options for completion after the
GRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same time
and in either order, but the tab completion was only working for one or
the other. Lastly, we weren't using the actual list of allowed kinds of
objects for default privileges for completion after the 'GRANT X ON' but
instead were completeing to what 'GRANT X ON' supports, which isn't the
ssame at all.
Address these issues by improving the forward tab-completion for ALTER
DEFAULT PRIVILEGES and then constrain and correct how the tail
completion is done when it is for ALTER DEFAULT PRIVILEGES.
Back-patch the forward/tail tab-completion to 9.6, where we made it easy
to handle such cases.
For 9.5 and earlier, correct the initial tab-completion to at least be
correct as far as it goes and then add a check for GRANT/REVOKE to only
tab-complete when the GRANT/REVOKE is the start of the command, so we
don't try to do tab-completion after we get to the GRANT/REVOKE part of
the ALTER DEFAULT PRIVILEGES command, which is better than providing
incorrect completions.
Initial patch for master and 9.6 by Gilles Darold, though I cleaned it
up and added a few comments. All bugs in the 9.5 and earlier patch are
mine.
Discussion: https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com
Branch
------
REL9_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/98f30a0e7d483402f2a7ebe5e6bbbbbba044c42c
Modified Files
--------------
src/bin/psql/tab-complete.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
* pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
@ 2016-12-24 02:02 Stephen Frost <sfrost@snowman.net>
2016-12-24 03:58 ` Re: pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Robert Haas <robertmhaas@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 02:02 UTC (permalink / raw)
To: pgsql-committers
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we are
including the list of roles as possible options for completion after the
GRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same time
and in either order, but the tab completion was only working for one or
the other. Lastly, we weren't using the actual list of allowed kinds of
objects for default privileges for completion after the 'GRANT X ON' but
instead were completeing to what 'GRANT X ON' supports, which isn't the
ssame at all.
Address these issues by improving the forward tab-completion for ALTER
DEFAULT PRIVILEGES and then constrain and correct how the tail
completion is done when it is for ALTER DEFAULT PRIVILEGES.
Back-patch the forward/tail tab-completion to 9.6, where we made it easy
to handle such cases.
For 9.5 and earlier, correct the initial tab-completion to at least be
correct as far as it goes and then add a check for GRANT/REVOKE to only
tab-complete when the GRANT/REVOKE is the start of the command, so we
don't try to do tab-completion after we get to the GRANT/REVOKE part of
the ALTER DEFAULT PRIVILEGES command, which is better than providing
incorrect completions.
Initial patch for master and 9.6 by Gilles Darold, though I cleaned it
up and added a few comments. All bugs in the 9.5 and earlier patch are
mine.
Discussion: https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/2022d594da3233dca4a4570b1e4e5d8a83ff6163
Modified Files
--------------
src/bin/psql/tab-complete.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
@ 2016-12-24 03:58 ` Robert Haas <robertmhaas@gmail.com>
2016-12-24 04:03 ` Re: pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 8+ messages in thread
From: Robert Haas @ 2016-12-24 03:58 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-committers
On Fri, Dec 23, 2016 at 9:02 PM, Stephen Frost <sfrost@snowman.net> wrote:
> Lastly, we weren't using the actual list of allowed kinds of
> objects for default privileges for completion after the 'GRANT X ON' but
> instead were completeing to what 'GRANT X ON' supports, which isn't the
> ssame at all.
/me scratches head.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
2016-12-24 03:58 ` Re: pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Robert Haas <robertmhaas@gmail.com>
@ 2016-12-24 04:03 ` Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 04:03 UTC (permalink / raw)
To: Robert Haas <robertmhaas@gmail.com>; +Cc: pgsql-committers
* Robert Haas (robertmhaas@gmail.com) wrote:
> On Fri, Dec 23, 2016 at 9:02 PM, Stephen Frost <sfrost@snowman.net> wrote:
> > Lastly, we weren't using the actual list of allowed kinds of
> > objects for default privileges for completion after the 'GRANT X ON' but
> > instead were completeing to what 'GRANT X ON' supports, which isn't the
> > ssame at all.
>
> /me scratches head.
'ALTER DEFAULT PRIVILEGES ... GRANT X ON' can be followed by the literal
term 'TABLES', or 'FUNCTIONS', etc.
'GRANT X ON ' can be followed by an actual table.
A bit awkward to write out in a single sentence though.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
^ permalink raw reply [nested|flat] 8+ messages in thread
* pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
@ 2016-12-24 02:02 Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Frost @ 2016-12-24 02:02 UTC (permalink / raw)
To: pgsql-committers
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we are
including the list of roles as possible options for completion after the
GRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same time
and in either order, but the tab completion was only working for one or
the other. Lastly, we weren't using the actual list of allowed kinds of
objects for default privileges for completion after the 'GRANT X ON' but
instead were completeing to what 'GRANT X ON' supports, which isn't the
ssame at all.
Address these issues by improving the forward tab-completion for ALTER
DEFAULT PRIVILEGES and then constrain and correct how the tail
completion is done when it is for ALTER DEFAULT PRIVILEGES.
Back-patch the forward/tail tab-completion to 9.6, where we made it easy
to handle such cases.
For 9.5 and earlier, correct the initial tab-completion to at least be
correct as far as it goes and then add a check for GRANT/REVOKE to only
tab-complete when the GRANT/REVOKE is the start of the command, so we
don't try to do tab-completion after we get to the GRANT/REVOKE part of
the ALTER DEFAULT PRIVILEGES command, which is better than providing
incorrect completions.
Initial patch for master and 9.6 by Gilles Darold, though I cleaned it
up and added a few comments. All bugs in the 9.5 and earlier patch are
mine.
Discussion: https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com
Branch
------
REL9_2_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/26b55d669092e8b69104f49d16f8cc250a7a41ee
Modified Files
--------------
src/bin/psql/tab-complete.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2016-12-24 04:03 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
2016-12-24 03:58 ` Robert Haas <robertmhaas@gmail.com>
2016-12-24 04:03 ` Stephen Frost <sfrost@snowman.net>
2016-12-24 02:02 pgsql: Fix tab completion in psql for ALTER DEFAULT PRIVILEGES Stephen Frost <sfrost@snowman.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox