pgsql: Fix dbtoepub output file name

2019-02-21 Thread Peter Eisentraut
Fix dbtoepub output file name In previous releases, the input file of dbtoepub was postgres.xml, and dbtoepub knows to derive the output file name postgres.epub from that automatically. But now the intput file is postgres.sgml (since postgres.sgml is itself an XML file and we no longer need the i

pgsql: Fix dbtoepub output file name

2019-02-21 Thread Peter Eisentraut
Fix dbtoepub output file name In previous releases, the input file of dbtoepub was postgres.xml, and dbtoepub knows to derive the output file name postgres.epub from that automatically. But now the intput file is postgres.sgml (since postgres.sgml is itself an XML file and we no longer need the i

pgsql: Delay lock acquisition for partitions until we route a tuple to

2019-02-21 Thread Robert Haas
Delay lock acquisition for partitions until we route a tuple to them. Instead of locking all partitions to which we might route a tuple at executor startup, just lock them as we use them. In some cases such a partition might get locked at executor startup anyway because it appears in the query's

pgsql: Move code for managing PartitionDescs into a new file, partdesc.

2019-02-21 Thread Robert Haas
Move code for managing PartitionDescs into a new file, partdesc.c This is similar in spirit to the existing partbounds.c file in the same directory, except that there's a lot less code in the new file created by this commit. Pending work in this area proposes to add a bunch more code related to P

pgsql: pg_regress: Don't use absolute paths for the diff

2019-02-21 Thread Peter Eisentraut
pg_regress: Don't use absolute paths for the diff Don't expand inputfile and outputfile to absolute paths globally, just where needed. In particular, pass them as is to the file name arguments of the diff command, so that we don't see the full absolute path in the diff header, which makes the dif

pgsql: Hide other user's pg_stat_ssl rows

2019-02-21 Thread Peter Eisentraut
Hide other user's pg_stat_ssl rows Change pg_stat_ssl so that an unprivileged user can only see their own rows; other rows will be all null. This makes the behavior consistent with pg_stat_activity, where information about where the connection came from is also restricted. Reviewed-by: Michael P

pgsql: doc: Add security information about pg_stat_activity

2019-02-21 Thread Peter Eisentraut
doc: Add security information about pg_stat_activity Add a basic note that some columns in pg_stat_activity and related views are not visible to all users. Discussion: https://www.postgresql.org/message-id/3018acd9-e5d8-1e85-5ed7-47276cd77569%402ndquadrant.com Branch -- master Details

pgsql: Move estimate_hashagg_tablesize to selfuncs.c, and widen result

2019-02-21 Thread Tom Lane
Move estimate_hashagg_tablesize to selfuncs.c, and widen result to double. It seems to make more sense for this to be in selfuncs.c, since it's largely a statistical-estimation thing, and it's related to other functions like estimate_hash_bucket_stats that are there. While at it, change the resul

pgsql: Fix mark-and-restore-skipping test case to not be a self-join.

2019-02-21 Thread Tom Lane
Fix mark-and-restore-skipping test case to not be a self-join. There isn't any good reason for this test to be a self-join rather than a join between separate tables, except that it saved a couple of SQL commands for setup. A proposed patch to optimize away self-joins breaks the test, so adjust i

pgsql: Remove duplicate variable declaration in fe-connect.c

2019-02-21 Thread Michael Paquier
Remove duplicate variable declaration in fe-connect.c The same variables are declared twice when checking if a connection is writable, which is useless. Author: Haribabu Kommi Discussion: https://postgr.es/m/CAJrrPGf=rcalb54w_tg1_hx3y+cgswaery-uysqzgc3zt5x...@mail.gmail.com Branch -- master