[COMMITTERS] pgsql: pg_upgrade: Fix fatal error handling

2014-01-08 Thread Peter Eisentraut
pg_upgrade: Fix fatal error handling Restore exiting when pg_log(PG_FATAL) is called directly instead of calling pg_fatal(). Fault introduced in 264aa14a2f687eba8c8cc2a5b6cbd6397973da98. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/ca607b155e86ce529fc9ac322a232f2

[COMMITTERS] pgsql: Fix bug in determining when recovery has reached consistency.

2014-01-08 Thread Heikki Linnakangas
Fix bug in determining when recovery has reached consistency. When starting WAL replay from an online checkpoint, the last replayed WAL record variable was initialized using the checkpoint record's location, even though the records between the REDO location and the checkpoint record had not been r

[COMMITTERS] pgsql: Fix bug in determining when recovery has reached consistency.

2014-01-08 Thread Heikki Linnakangas
Fix bug in determining when recovery has reached consistency. When starting WAL replay from an online checkpoint, the last replayed WAL record variable was initialized using the checkpoint record's location, even though the records between the REDO location and the checkpoint record had not been r

[COMMITTERS] pgsql: Fix bug in determining when recovery has reached consistency.

2014-01-08 Thread Heikki Linnakangas
Fix bug in determining when recovery has reached consistency. When starting WAL replay from an online checkpoint, the last replayed WAL record variable was initialized using the checkpoint record's location, even though the records between the REDO location and the checkpoint record had not been r

[COMMITTERS] pgsql: Fix bug in determining when recovery has reached consistency.

2014-01-08 Thread Heikki Linnakangas
Fix bug in determining when recovery has reached consistency. When starting WAL replay from an online checkpoint, the last replayed WAL record variable was initialized using the checkpoint record's location, even though the records between the REDO location and the checkpoint record had not been r

[COMMITTERS] pgsql: Fix bug in determining when recovery has reached consistency.

2014-01-08 Thread Heikki Linnakangas
Fix bug in determining when recovery has reached consistency. When starting WAL replay from an online checkpoint, the last replayed WAL record variable was initialized using the checkpoint record's location, even though the records between the REDO location and the checkpoint record had not been r

[COMMITTERS] pgsql: Save a few cycles in advance_transition_function().

2014-01-08 Thread Tom Lane
Save a few cycles in advance_transition_function(). Keep a pre-initialized FunctionCallInfoData in AggStatePerAggData, and re-use that at each row instead of doing InitFunctionCallInfoData each time. This saves only half a dozen assignments and maybe some stack manipulation, and yet that seems to

[COMMITTERS] pgsql: Avoid extra AggCheckCallContext() checks in ordered-set aggregat

2014-01-08 Thread Tom Lane
Avoid extra AggCheckCallContext() checks in ordered-set aggregates. In the transition functions, we don't really need to recheck this after the first call. I had been feeling paranoid about possibly getting a non-null argument value in some other context; but it's probably game over anyway if we

[COMMITTERS] pgsql: Fix pause_at_recovery_target + recovery_target_inclusive combina

2014-01-08 Thread Heikki Linnakangas
Fix pause_at_recovery_target + recovery_target_inclusive combination. If pause_at_recovery_target is set, recovery pauses *before* applying the target record, even if recovery_target_inclusive is set. If you then continue with pg_xlog_replay_resume(), it will apply the target record before ending

[COMMITTERS] pgsql: If multiple recovery_targets are specified, use the latest one.

2014-01-08 Thread Heikki Linnakangas
If multiple recovery_targets are specified, use the latest one. The docs say that only one of recovery_target_xid, recovery_target_time, or recovery_target_name can be specified. But the code actually did something different, so that a name overrode time, and xid overrode both time and name. Now t

[COMMITTERS] pgsql: Fix pause_at_recovery_target + recovery_target_inclusive combina

2014-01-08 Thread Heikki Linnakangas
Fix pause_at_recovery_target + recovery_target_inclusive combination. If pause_at_recovery_target is set, recovery pauses *before* applying the target record, even if recovery_target_inclusive is set. If you then continue with pg_xlog_replay_resume(), it will apply the target record before ending

[COMMITTERS] pgsql: Fix pause_at_recovery_target + recovery_target_inclusive combina

2014-01-08 Thread Heikki Linnakangas
Fix pause_at_recovery_target + recovery_target_inclusive combination. If pause_at_recovery_target is set, recovery pauses *before* applying the target record, even if recovery_target_inclusive is set. If you then continue with pg_xlog_replay_resume(), it will apply the target record before ending

[COMMITTERS] pgsql: Fix pause_at_recovery_target + recovery_target_inclusive combina

2014-01-08 Thread Heikki Linnakangas
Fix pause_at_recovery_target + recovery_target_inclusive combination. If pause_at_recovery_target is set, recovery pauses *before* applying the target record, even if recovery_target_inclusive is set. If you then continue with pg_xlog_replay_resume(), it will apply the target record before ending

[COMMITTERS] pgsql: Reduce the number of semaphores used under --disable-spinlocks.

2014-01-08 Thread Robert Haas
Reduce the number of semaphores used under --disable-spinlocks. Instead of allocating a semaphore from the operating system for every spinlock, allocate a fixed number of semaphores (by default, 1024) from the operating system and multiplex all the spinlocks that get created onto them. This could

[COMMITTERS] pgsql: Fix "cannot accept a set" error when only some arms of a CASE re

2014-01-08 Thread Tom Lane
Fix "cannot accept a set" error when only some arms of a CASE return a set. In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an optimization that assumed that a function's argument expressions would either always return a set (ie multiple rows), or always not. This is wrong howev

[COMMITTERS] pgsql: Fix "cannot accept a set" error when only some arms of a CASE re

2014-01-08 Thread Tom Lane
Fix "cannot accept a set" error when only some arms of a CASE return a set. In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an optimization that assumed that a function's argument expressions would either always return a set (ie multiple rows), or always not. This is wrong howev

[COMMITTERS] pgsql: Fix "cannot accept a set" error when only some arms of a CASE re

2014-01-08 Thread Tom Lane
Fix "cannot accept a set" error when only some arms of a CASE return a set. In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an optimization that assumed that a function's argument expressions would either always return a set (ie multiple rows), or always not. This is wrong howev

[COMMITTERS] pgsql: Fix "cannot accept a set" error when only some arms of a CASE re

2014-01-08 Thread Tom Lane
Fix "cannot accept a set" error when only some arms of a CASE return a set. In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an optimization that assumed that a function's argument expressions would either always return a set (ie multiple rows), or always not. This is wrong howev

[COMMITTERS] pgsql: Fix "cannot accept a set" error when only some arms of a CASE re

2014-01-08 Thread Tom Lane
Fix "cannot accept a set" error when only some arms of a CASE return a set. In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an optimization that assumed that a function's argument expressions would either always return a set (ie multiple rows), or always not. This is wrong howev

[COMMITTERS] pgsql: Fix "cannot accept a set" error when only some arms of a CASE re

2014-01-08 Thread Tom Lane
Fix "cannot accept a set" error when only some arms of a CASE return a set. In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an optimization that assumed that a function's argument expressions would either always return a set (ie multiple rows), or always not. This is wrong howev

[COMMITTERS] pgsql: We don't need to include pg_sema.h in s_lock.h anymore.

2014-01-08 Thread Tom Lane
We don't need to include pg_sema.h in s_lock.h anymore. Minor improvement to commit daa7527afc2274432094ebe7ceb03aa41f916607: s_lock.h no longer has any need to mention PGSemaphoreData, so we can rip out the #include that supplies that. In a non-HAVE_SPINLOCKS build, this doesn't really buy much