[COMMITTERS] pgsql: Fix very minor memory leaks in psql's command.c.

2017-07-27 Thread Tom Lane
Fix very minor memory leaks in psql's command.c. \drds leaked its second pattern argument if any, and \connect leaked any empty-string or "-" arguments. These are old bugs, but it's hard to imagine any real use-case where the leaks could amount to anything meaningful, so not bothering with a back

[COMMITTERS] pgsql: Standardize describe.c's behavior for no-matching-objects a bit

2017-07-27 Thread Tom Lane
Standardize describe.c's behavior for no-matching-objects a bit more. Most functions in this file are content to print an empty table if there are no matching objects. In some, the behavior is to loop over all matching objects and print a table for each one; therefore, without any extra logic, no

[COMMITTERS] pgsql: Avoid use of sprintf/snprintf in describe.c.

2017-07-27 Thread Tom Lane
Avoid use of sprintf/snprintf in describe.c. Most places were already using the PQExpBuffer library for constructing variable-length strings; bring the two stragglers into line. describeOneTSParser was living particularly dangerously since it wasn't even using snprintf(). Daniel Gustafsson Discu

[COMMITTERS] pgsql: Sync listDbRoleSettings() with the rest of the world.

2017-07-27 Thread Tom Lane
Sync listDbRoleSettings() with the rest of the world. listDbRoleSettings() handled its server version check randomly differently from every other comparable function in describe.c, not only as to code layout but also message wording. It also leaked memory, because its PQExpBuffer management was a

[COMMITTERS] pgsql: Fix psql tab completion for CREATE USER MAPPING.

2017-07-27 Thread Tom Lane
Fix psql tab completion for CREATE USER MAPPING. After typing CREATE USER M..., it would not fill in MAPPING FOR, even though that was clearly intended behavior. Jeff Janes Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqob5nxepn0ppanetkhr3upooq+ny...@mail.gmail.com Branch -- REL9_6_S

[COMMITTERS] pgsql: Fix psql tab completion for CREATE USER MAPPING.

2017-07-27 Thread Tom Lane
Fix psql tab completion for CREATE USER MAPPING. After typing CREATE USER M..., it would not fill in MAPPING FOR, even though that was clearly intended behavior. Jeff Janes Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqob5nxepn0ppanetkhr3upooq+ny...@mail.gmail.com Branch -- REL9_4_S

[COMMITTERS] pgsql: Fix psql tab completion for CREATE USER MAPPING.

2017-07-27 Thread Tom Lane
Fix psql tab completion for CREATE USER MAPPING. After typing CREATE USER M..., it would not fill in MAPPING FOR, even though that was clearly intended behavior. Jeff Janes Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqob5nxepn0ppanetkhr3upooq+ny...@mail.gmail.com Branch -- REL9_2_S

[COMMITTERS] pgsql: Fix psql tab completion for CREATE USER MAPPING.

2017-07-27 Thread Tom Lane
Fix psql tab completion for CREATE USER MAPPING. After typing CREATE USER M..., it would not fill in MAPPING FOR, even though that was clearly intended behavior. Jeff Janes Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqob5nxepn0ppanetkhr3upooq+ny...@mail.gmail.com Branch -- master

[COMMITTERS] pgsql: Fix psql tab completion for CREATE USER MAPPING.

2017-07-27 Thread Tom Lane
Fix psql tab completion for CREATE USER MAPPING. After typing CREATE USER M..., it would not fill in MAPPING FOR, even though that was clearly intended behavior. Jeff Janes Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqob5nxepn0ppanetkhr3upooq+ny...@mail.gmail.com Branch -- REL9_3_S

[COMMITTERS] pgsql: Fix psql tab completion for CREATE USER MAPPING.

2017-07-27 Thread Tom Lane
Fix psql tab completion for CREATE USER MAPPING. After typing CREATE USER M..., it would not fill in MAPPING FOR, even though that was clearly intended behavior. Jeff Janes Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqob5nxepn0ppanetkhr3upooq+ny...@mail.gmail.com Branch -- REL9_5_S