Re: [COMMITTERS] pgsql: Fix accounting of memory needed for merge heap.

2016-12-08 Thread Peter Geoghegan
On Thu, Dec 8, 2016 at 1:07 PM, Heikki Linnakangas wrote: > D'oh, you're right, of course. Fixed, thanks for the vigilance! I've made exactly the same mistake myself before. :-) -- Peter Geoghegan -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)

Re: [COMMITTERS] pgsql: Fix accounting of memory needed for merge heap.

2016-12-08 Thread Heikki Linnakangas
On 12/08/2016 10:49 PM, Peter Geoghegan wrote: On Thu, Dec 8, 2016 at 12:20 AM, Heikki Linnakangas wrote: While we're at it, add a safeguard for the case that we are already over the limit when allocating the read buffers. That shouldn't happen, but better safe than

[COMMITTERS] pgsql: Fix thinko in safeguard for negative availMem.

2016-12-08 Thread Heikki Linnakangas
Fix thinko in safeguard for negative availMem. Also, use pass read_buffer_size * numInputTapes rather than just availMem to USEMEM, to be neat. Peter Geoghegan. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/64bc26f90d342ca343f5ba383a97691a58991204 Modified Files

Re: [COMMITTERS] pgsql: Fix accounting of memory needed for merge heap.

2016-12-08 Thread Peter Geoghegan
On Thu, Dec 8, 2016 at 12:20 AM, Heikki Linnakangas wrote: > While we're at it, add a safeguard for the case that we are already over > the limit when allocating the read buffers. That shouldn't happen, but > better safe than sorry. I think you should 's/Min/Max/'

[COMMITTERS] pgsql: Fix bogus comment.

2016-12-08 Thread Robert Haas
Fix bogus comment. Commit 4212cb73262bbdd164727beffa4c4744b4ead92d rendered a comment in execMain.c incorrect. Per complaint from Tom Lane, repair. Patch from Amit Kapila, per wording suggested by Tom Lane and me. Branch -- REL9_6_STABLE Details ---

[COMMITTERS] pgsql: Fix bogus comment.

2016-12-08 Thread Robert Haas
Fix bogus comment. Commit 4212cb73262bbdd164727beffa4c4744b4ead92d rendered a comment in execMain.c incorrect. Per complaint from Tom Lane, repair. Patch from Amit Kapila, per wording suggested by Tom Lane and me. Branch -- master Details ---

[COMMITTERS] pgsql: Silence compiler warning.

2016-12-08 Thread Robert Haas
Silence compiler warning. Per report from Stephen Frost. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/ab4575dcf18fad1bc20d4a1bde6dc33c8d2561b6 Modified Files -- src/backend/catalog/partition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --

[COMMITTERS] pgsql: Log the creation of an init fork unconditionally.

2016-12-08 Thread Robert Haas
Log the creation of an init fork unconditionally. Previously, it was thought that this only needed to be done for the benefit of possible standbys, so wal_level = minimal skipped it. But that's not safe, because during crash recovery we might replay XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record

[COMMITTERS] pgsql: Log the creation of an init fork unconditionally.

2016-12-08 Thread Robert Haas
Log the creation of an init fork unconditionally. Previously, it was thought that this only needed to be done for the benefit of possible standbys, so wal_level = minimal skipped it. But that's not safe, because during crash recovery we might replay XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record

[COMMITTERS] pgsql: Log the creation of an init fork unconditionally.

2016-12-08 Thread Robert Haas
Log the creation of an init fork unconditionally. Previously, it was thought that this only needed to be done for the benefit of possible standbys, so wal_level = minimal skipped it. But that's not safe, because during crash recovery we might replay XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record

[COMMITTERS] pgsql: Log the creation of an init fork unconditionally.

2016-12-08 Thread Robert Haas
Log the creation of an init fork unconditionally. Previously, it was thought that this only needed to be done for the benefit of possible standbys, so wal_level = minimal skipped it. But that's not safe, because during crash recovery we might replay XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record

[COMMITTERS] pgsql: Log the creation of an init fork unconditionally.

2016-12-08 Thread Robert Haas
Log the creation of an init fork unconditionally. Previously, it was thought that this only needed to be done for the benefit of possible standbys, so wal_level = minimal skipped it. But that's not safe, because during crash recovery we might replay XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record

[COMMITTERS] pgsql: Log the creation of an init fork unconditionally.

2016-12-08 Thread Robert Haas
Log the creation of an init fork unconditionally. Previously, it was thought that this only needed to be done for the benefit of possible standbys, so wal_level = minimal skipped it. But that's not safe, because during crash recovery we might replay XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record

[COMMITTERS] pgsql: Fix reporting of column typmods for multi-row VALUES constructs.

2016-12-08 Thread Tom Lane
Fix reporting of column typmods for multi-row VALUES constructs. expandRTE() and get_rte_attribute_type() reported the exprType() and exprTypmod() values of the expressions in the first row of the VALUES as being the column type/typmod returned by the VALUES RTE. That's fine for the data type,

[COMMITTERS] pgsql: Fix quoting and a compiler warning in dumping partitions.

2016-12-08 Thread Heikki Linnakangas
Fix quoting and a compiler warning in dumping partitions. Partition name needs to be quoted in the ATTACH PARTITION command constructed in binary-upgrade mode. Silence compiler warning about set but unused variable, without --enable-cassert. Branch -- master Details ---

[COMMITTERS] pgsql: Clean up password authentication code a bit.

2016-12-08 Thread Heikki Linnakangas
Clean up password authentication code a bit. Commit fe0a0b59, which moved code to do MD5 authentication to a separate CheckMD5Auth() function, left behind a comment that really belongs inside the function, too. Also move the check for db_user_namespace inside the function, seems clearer that way.

[COMMITTERS] pgsql: Fix accounting of memory needed for merge heap.

2016-12-08 Thread Heikki Linnakangas
Fix accounting of memory needed for merge heap. We allegedly allocated all remaining memory for the read buffers of the sort tapes, but we allocated the merge heap only after that. That means that the allocation of the merge heap was guaranteed to go over the memory limit. Fix by allocating the