pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Avoid statically allocating gmtsub()'s timezone workspace.

2018-10-16 Thread Tom Lane
Avoid statically allocating gmtsub()'s timezone workspace. localtime.c's "struct state" is a rather large object, ~23KB. We were statically allocating one for gmtsub() to use to represent the GMT timezone, even though that function is not at all heavily used and is never reached in most backends.

pgsql: Improve stability of recently-added regression test case.

2018-10-16 Thread Tom Lane
Improve stability of recently-added regression test case. Commit b5febc1d1 added a contrib/btree_gist test case that has been observed to fail in the buildfarm as a result of background auto-analyze updating stats and changing the selected plan. Forestall that by forcibly analyzing in foreground,

pgsql: Improve stability of recently-added regression test case.

2018-10-16 Thread Tom Lane
Improve stability of recently-added regression test case. Commit b5febc1d1 added a contrib/btree_gist test case that has been observed to fail in the buildfarm as a result of background auto-analyze updating stats and changing the selected plan. Forestall that by forcibly analyzing in foreground,

pgsql: Improve stability of recently-added regression test case.

2018-10-16 Thread Tom Lane
Improve stability of recently-added regression test case. Commit b5febc1d1 added a contrib/btree_gist test case that has been observed to fail in the buildfarm as a result of background auto-analyze updating stats and changing the selected plan. Forestall that by forcibly analyzing in foreground,

pgsql: Improve stability of recently-added regression test case.

2018-10-16 Thread Tom Lane
Improve stability of recently-added regression test case. Commit b5febc1d1 added a contrib/btree_gist test case that has been observed to fail in the buildfarm as a result of background auto-analyze updating stats and changing the selected plan. Forestall that by forcibly analyzing in foreground,

pgsql: Improve stability of recently-added regression test case.

2018-10-16 Thread Tom Lane
Improve stability of recently-added regression test case. Commit b5febc1d1 added a contrib/btree_gist test case that has been observed to fail in the buildfarm as a result of background auto-analyze updating stats and changing the selected plan. Forestall that by forcibly analyzing in foreground,

pgsql: Make PostgresNode.pm's poll_query_until() more chatty about fail

2018-10-16 Thread Tom Lane
Make PostgresNode.pm's poll_query_until() more chatty about failures. Reporting only the stderr is unhelpful when the problem is that the server output we're getting doesn't match what was expected. So we should report the query output too; and just for good measure, let's print the query we used

pgsql: Make PostgresNode.pm's poll_query_until() more chatty about fail

2018-10-16 Thread Tom Lane
Make PostgresNode.pm's poll_query_until() more chatty about failures. Reporting only the stderr is unhelpful when the problem is that the server output we're getting doesn't match what was expected. So we should report the query output too; and just for good measure, let's print the query we used

pgsql: Make PostgresNode.pm's poll_query_until() more chatty about fail

2018-10-16 Thread Tom Lane
Make PostgresNode.pm's poll_query_until() more chatty about failures. Reporting only the stderr is unhelpful when the problem is that the server output we're getting doesn't match what was expected. So we should report the query output too; and just for good measure, let's print the query we used

pgsql: Make PostgresNode.pm's poll_query_until() more chatty about fail

2018-10-16 Thread Tom Lane
Make PostgresNode.pm's poll_query_until() more chatty about failures. Reporting only the stderr is unhelpful when the problem is that the server output we're getting doesn't match what was expected. So we should report the query output too; and just for good measure, let's print the query we used

pgsql: Make PostgresNode.pm's poll_query_until() more chatty about fail

2018-10-16 Thread Tom Lane
Make PostgresNode.pm's poll_query_until() more chatty about failures. Reporting only the stderr is unhelpful when the problem is that the server output we're getting doesn't match what was expected. So we should report the query output too; and just for good measure, let's print the query we used

pgsql: Correct constness of system attributes in heap.c & prerequisites

2018-10-16 Thread Andres Freund
Correct constness of system attributes in heap.c & prerequisites. This allows the compiler / linker to mark affected pages as read-only. There's a fair number of pre-requisite changes, to allow the const properly be propagated. Most of consts were already required for correctness anyway, just not

pgsql: Avoid statically allocating formatting.c's format string caches.

2018-10-16 Thread Tom Lane
Avoid statically allocating formatting.c's format string caches. This eliminates circa 120KB of static data from Postgres' memory footprint. In some usage patterns that space will get allocated anyway, but in many processes it never will be allocated. We can improve matters further by allocating

pgsql: Fix mis-backpatch of c015ccb306ec81bca3023818c9cf0113cae25be1.

2018-10-16 Thread Tom Lane
Fix mis-backpatch of c015ccb306ec81bca3023818c9cf0113cae25be1. Per buildfarm. Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a485bacef177b4cd476b9437f8fb6cb8dce58944 Modified Files -- src/test/perl/PostgresNode.pm | 2 +- 1 file changed, 1 insert

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Avoid rare race condition in privileges.sql regression test.

2018-10-16 Thread Tom Lane
Avoid rare race condition in privileges.sql regression test. We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibit

pgsql: Be smarter about age-counter overflow in formatting.c caches.

2018-10-16 Thread Tom Lane
Be smarter about age-counter overflow in formatting.c caches. The previous code here simply threw away whatever it knew about cache entry ages whenever a counter overflow occurred. Since the counter is int width and will be bumped once per format function execution, overflows are not really so ra

pgsql: Mark constantly allocated dest receiver as const.

2018-10-16 Thread Andres Freund
Mark constantly allocated dest receiver as const. This allows the compiler / linker to mark affected pages as read-only. Doing so requires casting constness away, as CreateDestReceiver() returns both constant and non-constant dest receivers. That's fine though, as any modification of the statical

pgsql: Add macro to cast away const without allowing changes to underly

2018-10-16 Thread Andres Freund
Add macro to cast away const without allowing changes to underlying type. The new unconsitify(underlying_type, var) macro allows to cast constness away from a variable, but doesn't allow changing the underlying type. Enforcement of the latter currently only works for gcc like compilers. Please n

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Back off using -isysroot on Darwin.

2018-10-16 Thread Tom Lane
Back off using -isysroot on Darwin. Rethink the solution applied in commit 5e2217131 to get PL/Tcl to build on macOS Mojave. I feared that adding -isysroot globally might have undesirable consequences, and sure enough Jakob Egger reported one: it complicates building extensions with a different X

pgsql: Reorder FmgrBuiltin members, saving 25% in size.

2018-10-16 Thread Andres Freund
Reorder FmgrBuiltin members, saving 25% in size. That's worth it, as fmgr_builtins is frequently accessed, and as fmgr_builtins is one of the biggest constant variables in a backend. On most 64bit systems this will change the size of the struct from 32byte to 24bytes. While that could make indexi

pgsql: Tag refs/tags/REL_11_0 was created

2018-10-16 Thread pgsql
Tag refs/tags/REL_11_0 was created.

pgsql: Formatting cleanup in ecpglib/prepare.c.

2018-10-16 Thread Tom Lane
Formatting cleanup in ecpglib/prepare.c. Looking at this code made my head hurt. Format the comments more like the way it's done elsewhere, break a few overly long lines. No actual code changes in this commit. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/92dff34

pgsql: Avoid statically allocating statement cache in ecpglib/prepare.c

2018-10-16 Thread Tom Lane
Avoid statically allocating statement cache in ecpglib/prepare.c. This removes a megabyte of storage that isn't used at all in ecpglib's default operating mode --- you have to enable auto-prepare to get any use out of it. Seems well worth the trouble to allocate on demand. Discussion: https://p