[COMMITTERS] pgsql: Fix minor memory leak in Standby startup

2016-09-08 Thread Simon Riggs
Fix minor memory leak in Standby startup StandbyRecoverPreparedTransactions() leaked the buffer used for two phase state file. This was leaked once at startup and at every shutdown checkpoint seen. Backpatch to 9.6 Stas Kelvich Branch -- master Details --- http://git.postgresql.org/pg/

[COMMITTERS] pgsql: Fix minor memory leak in Standby startup

2016-09-08 Thread Simon Riggs
Fix minor memory leak in Standby startup StandbyRecoverPreparedTransactions() leaked the buffer used for two phase state file. This was leaked once at startup and at every shutdown checkpoint seen. Backpatch to 9.6 Stas Kelvich Branch -- REL9_6_STABLE Details --- http://git.postgresql.

[COMMITTERS] pgsql: Don't print database's tablespace in pg_dump -C --no-tablespaces

2016-09-08 Thread Tom Lane
Don't print database's tablespace in pg_dump -C --no-tablespaces output. If the database has a non-default tablespace, we emitted a TABLESPACE clause in the CREATE DATABASE command emitted by -C, even if --no-tablespaces was also specified. This seems wrong, and it's inconsistent with what pg_dum

[COMMITTERS] pgsql: Don't print database's tablespace in pg_dump -C --no-tablespaces

2016-09-08 Thread Tom Lane
Don't print database's tablespace in pg_dump -C --no-tablespaces output. If the database has a non-default tablespace, we emitted a TABLESPACE clause in the CREATE DATABASE command emitted by -C, even if --no-tablespaces was also specified. This seems wrong, and it's inconsistent with what pg_dum

[COMMITTERS] pgsql: Don't print database's tablespace in pg_dump -C --no-tablespaces

2016-09-08 Thread Tom Lane
Don't print database's tablespace in pg_dump -C --no-tablespaces output. If the database has a non-default tablespace, we emitted a TABLESPACE clause in the CREATE DATABASE command emitted by -C, even if --no-tablespaces was also specified. This seems wrong, and it's inconsistent with what pg_dum

[COMMITTERS] pgsql: Allow pg_dump to dump non-extension members of an extension-owne

2016-09-08 Thread Tom Lane
Allow pg_dump to dump non-extension members of an extension-owned schema. Previously, if a schema was created by an extension, a normal pg_dump run (not --binary-upgrade) would summarily skip every object in that schema. In a case where an extension creates a schema and then users create other obj

[COMMITTERS] pgsql: Allow pg_dump to dump non-extension members of an extension-owne

2016-09-08 Thread Tom Lane
Allow pg_dump to dump non-extension members of an extension-owned schema. Previously, if a schema was created by an extension, a normal pg_dump run (not --binary-upgrade) would summarily skip every object in that schema. In a case where an extension creates a schema and then users create other obj

[COMMITTERS] pgsql: Fix two src/test/modules Makefiles

2016-09-08 Thread Alvaro Herrera
Fix two src/test/modules Makefiles commit_ts and test_pg_dump were declaring targets before including the PGXS stanza, which meant that the "all" target customarily defined as the first (and therefore default target) was not the default anymore. Fix that by moving those target definitions to after

[COMMITTERS] pgsql: Fix two src/test/modules Makefiles

2016-09-08 Thread Alvaro Herrera
Fix two src/test/modules Makefiles commit_ts and test_pg_dump were declaring targets before including the PGXS stanza, which meant that the "all" target customarily defined as the first (and therefore default target) was not the default anymore. Fix that by moving those target definitions to after

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

2016-09-08 Thread Andres Freund
Fix mdtruncate() to close fd.c handle of deleted segments. mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting it. That lead to a fd.c handle to a truncated file being kept open until backend exit. The issue appears to have been introduced way back in 1a5c450f3024ac5, before th

[COMMITTERS] pgsql: Faster PageIsVerified() for the all zeroes case.

2016-09-08 Thread Andres Freund
Faster PageIsVerified() for the all zeroes case. That's primarily useful for testing very large relations, using sparse files. Discussion: <[email protected]> Reviewed-By: Peter Geoghegan Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/417fefa

[COMMITTERS] pgsql: Improve scalability of md.c for large relations.

2016-09-08 Thread Andres Freund
Improve scalability of md.c for large relations. So far md.c used a linked list of segments. That proved to be a problem when processing large relations, because every smgr.c/md.c level access to a page incurred walking through a linked list of all preceding segments. Thus making accessing pages O