pgsql: Enable parallel query with SERIALIZABLE isolation.

2019-03-14 Thread Thomas Munro
Enable parallel query with SERIALIZABLE isolation. Previously, the SERIALIZABLE isolation level prevented parallel query from being used. Allow the two features to be used together by sharing the leader's SERIALIZABLEXACT with parallel workers. An extra per-SERIALIZABLEXACT LWLock is introduced

pgsql: During pg_upgrade, conditionally skip transfer of FSMs.

2019-03-14 Thread Amit Kapila
During pg_upgrade, conditionally skip transfer of FSMs. If a heap on the old cluster has 4 pages or fewer, and the old cluster was PG v11 or earlier, don't copy or link the FSM. This will shrink space usage for installations with large numbers of small tables. This will allow pg_upgrade to take a

Re: pgsql: Fix thinko when bumping on temporary directories in pg_verify_ch

2019-03-14 Thread Michael Paquier
On Thu, Mar 14, 2019 at 08:39:10AM -0400, Robert Haas wrote: > On Thu, Mar 14, 2019 at 1:16 AM Michael Paquier wrote: > > Fix thinko when bumping on temporary directories in pg_verify_checksums > > What the heck does it mean to bump on a directory? My apologies for the confusion. It looks like

pgsql: Reorder identity regression test

2019-03-14 Thread Peter Eisentraut
Reorder identity regression test The previous test order had the effect that if something was wrong with the identity functionality, the create_table_like test would likely fail or crash first, which is confusing. Reorder so that the identity test comes before create_table_like. Branch -- ma

pgsql: Fix some oversights in commit 2455ab488.

2019-03-14 Thread Tom Lane
Fix some oversights in commit 2455ab488. The idea was to generate all the junk in a destroyable subcontext rather than leaking it in the caller's context, but partition_bounds_create was still being called in the caller's context, allowing plenty of scope for leakage. Also, get_rel_relkind() was

pgsql: Improve code comment

2019-03-14 Thread Peter Eisentraut
Improve code comment Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/61dc407893600f551dbcbc235d1dccd134f43da0 Modified Files -- src/backend/commands/copy.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-)

pgsql: Remove unused #include

2019-03-14 Thread Peter Eisentraut
Remove unused #include Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8bee36708f6ee4bf93be68f9a368379b0e9c6474 Modified Files -- src/backend/executor/execMain.c | 1 - 1 file changed, 1 deletion(-)

pgsql: Add BKI_DEFAULT to pg_class.relrewrite

2019-03-14 Thread Peter Eisentraut
Add BKI_DEFAULT to pg_class.relrewrite This column is always 0 on disk, so it doesn't have to be tracked separately for each entry. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b13a913607b9b304d16029361b1b17e10783cf7c Modified Files -- src/include/ca

pgsql: Ensure dummy paths have correct required_outer if rel is paramet

2019-03-14 Thread Tom Lane
Ensure dummy paths have correct required_outer if rel is parameterized. The assertions added by commits 34ea1ab7f et al found another problem: set_dummy_rel_pathlist and mark_dummy_rel were failing to label the dummy paths they create with the correct outer_relids, in case the relation is necessar

pgsql: Ensure dummy paths have correct required_outer if rel is paramet

2019-03-14 Thread Tom Lane
Ensure dummy paths have correct required_outer if rel is parameterized. The assertions added by commits 34ea1ab7f et al found another problem: set_dummy_rel_pathlist and mark_dummy_rel were failing to label the dummy paths they create with the correct outer_relids, in case the relation is necessar

pgsql: Ensure dummy paths have correct required_outer if rel is paramet

2019-03-14 Thread Tom Lane
Ensure dummy paths have correct required_outer if rel is parameterized. The assertions added by commits 34ea1ab7f et al found another problem: set_dummy_rel_pathlist and mark_dummy_rel were failing to label the dummy paths they create with the correct outer_relids, in case the relation is necessar

pgsql: Ensure dummy paths have correct required_outer if rel is paramet

2019-03-14 Thread Tom Lane
Ensure dummy paths have correct required_outer if rel is parameterized. The assertions added by commits 34ea1ab7f et al found another problem: set_dummy_rel_pathlist and mark_dummy_rel were failing to label the dummy paths they create with the correct outer_relids, in case the relation is necessar

pgsql: Ensure dummy paths have correct required_outer if rel is paramet

2019-03-14 Thread Tom Lane
Ensure dummy paths have correct required_outer if rel is parameterized. The assertions added by commits 34ea1ab7f et al found another problem: set_dummy_rel_pathlist and mark_dummy_rel were failing to label the dummy paths they create with the correct outer_relids, in case the relation is necessar

pgsql: Ensure dummy paths have correct required_outer if rel is paramet

2019-03-14 Thread Tom Lane
Ensure dummy paths have correct required_outer if rel is parameterized. The assertions added by commits 34ea1ab7f et al found another problem: set_dummy_rel_pathlist and mark_dummy_rel were failing to label the dummy paths they create with the correct outer_relids, in case the relation is necessar

pgsql: Defend against leaks into RelationBuildPartitionDesc.

2019-03-14 Thread Robert Haas
Defend against leaks into RelationBuildPartitionDesc. In normal builds, this isn't very important, because the leaks go into fairly short-lived contexts, but under CLOBBER_CACHE_ALWAYS, this can result in leaking hundreds of megabytes into MessageContext, which probably explains recent failures on

Re: pgsql: Fix thinko when bumping on temporary directories in pg_verify_ch

2019-03-14 Thread Robert Haas
On Thu, Mar 14, 2019 at 1:16 AM Michael Paquier wrote: > Fix thinko when bumping on temporary directories in pg_verify_checksums What the heck does it mean to bump on a directory? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

pgsql: Refactor ParamListInfo initialization

2019-03-14 Thread Peter Eisentraut
Refactor ParamListInfo initialization There were six copies of identical nontrivial code. Put it into a function. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c6ff0b892c30122b75d32c524109d16ee3c973f0 Modified Files -- src/backend/commands/prepare.c

pgsql: Fix volatile vs. pointer confusion

2019-03-14 Thread Peter Eisentraut
Fix volatile vs. pointer confusion Variables used after a longjmp() need to be declared volatile. In case of a pointer, it's the pointer itself that needs to be declared volatile, not the pointed-to value. So we need PyObject *volatile items; instead of volatile PyObject *items; /* w