Le 20/11/2016 à 15:46, Gilles Darold a écrit : > Hi, > > When tab-completing after ALTER DEFAULT PRIVILEGES ... GRANT|REVOKE, > currently psql injects completion from the GRANT|REVOKE order, rather > than the one expected. > > A patch is attached. It adds the right completion to GRANT|REVOKE after > ALTER DEFAULT PRIVILEGES and after FOR ROLE|USER + IN SCHEMA. > > If there's no objection I will add it to next commit fest. > > Best regards,
Added to next commitfest. To explain more this patch, the completion of SQL command: ALTER DEFAULT PRIVILEGES FOR ROLE xxx [tab] propose: GRANT REVOKE and it should also propose IN SCHEMA. Same with ALTER DEFAULT PRIVILEGES IN SCHEMA it should propose FOR ROLE. For example: gilles=# ALTER DEFAULT PRIVILEGES IN SCHEMA public FOR ROLE user1 GRANT ALL ON TABLES TO user2; ALTER DEFAULT PRIVILEGES is valid but current completion doesn't help. The second issue addressed is the completion after GRANT|REVOKE, which show completion for the GRANT|REVOKE command but the element are not the same in the ALTER DEFAULT PRIVILEGES command. I mean completion on command ALTER DEFAULT PRIVILEGES IN SCHEMA public FOR ROLE user1 GRANT ALL [tab] propose the following keywords: ALL FUNCTIONS IN SCHEMA ALL SEQUENCES IN SCHEMA DOMAIN LANGUAGE LARGE OBJECT TABLE TABLESPACE ALL TABLES IN SCHEMA FOREIGN DATA WRAPPER FOREIGN SERVER SCHEMA FUNCTION SEQUENCE TYPE DATABASE which is wrong. Keywords should only be ON TABLES ON SEQUENCES ON FUNCTIONS ON TYPES This is what the patch is trying to fix. -- Gilles Darold Consultant PostgreSQL http://dalibo.com - http://dalibo.org -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers