pgsql: Fix wrong file path in header comment

2018-07-11 Thread Alexander Korotkov
Fix wrong file path in header comment Header comment of shm_mq.c was mistakenly specifying path to shm_mq.h. It was introduced in ec9037df. So, theoretically it could be backpatched to 9.4, but it doesn't seem to worth it. Branch -- master Details --- https://git.postgresql.org/pg/commi

pgsql: Rethink how to get float.h in old Windows API for isnan/isinf

2018-07-11 Thread Alvaro Herrera
Rethink how to get float.h in old Windows API for isnan/isinf We include in every place that needs isnan(), because MSVC used to require it. However, since MSVC 2013 that's no longer necessary (cf. commit cec8394b5ccd), so we can retire the inclusion to a version-specific stanza in win32_port.h,

Re: pgsql: Fix wrong file path in header comment

2018-07-11 Thread Alexander Korotkov
On Wed, Jul 11, 2018 at 1:26 PM Alexander Korotkov wrote: > Header comment of shm_mq.c was mistakenly specifying path to shm_mq.h. > It was introduced in ec9037df. So, theoretically it could be > backpatched to 9.4, but it doesn't seem to worth it. I didn't backpatch, because I thought it doesn'

Re: pgsql: Fix wrong file path in header comment

2018-07-11 Thread Tom Lane
Alexander Korotkov writes: > I didn't backpatch, because I thought it doesn't worth it to create > buzz over single wrong path in the comment. But, I found 12 similar > cases in our source tree. Do you think it worth backpatching now? Nah, just fix 'em in HEAD. regards,

Re: pgsql: Fix wrong file path in header comment

2018-07-11 Thread Alexander Korotkov
On Wed, Jul 11, 2018 at 5:36 PM Tom Lane wrote: > > Alexander Korotkov writes: > > I didn't backpatch, because I thought it doesn't worth it to create > > buzz over single wrong path in the comment. But, I found 12 similar > > cases in our source tree. Do you think it worth backpatching now? >

pgsql: Fix more wrong paths in header comments

2018-07-11 Thread Alexander Korotkov
Fix more wrong paths in header comments It appears that there are more files, whose header comment paths are wrong. So, fix those paths. No backpatching per proposal of Tom Lane. Discussion: https://postgr.es/m/CAPpHfdsJyYbOj59MOQL%2B4XxdcomLSLfLqBtAvwR%2BpsCqj3ELdQ%40mail.gmail.com Branch --

pgsql: Fix bugs with degenerate window ORDER BY clauses in GROUPS/RANGE

2018-07-11 Thread Tom Lane
Fix bugs with degenerate window ORDER BY clauses in GROUPS/RANGE mode. nodeWindowAgg.c failed to cope with the possibility that no ordering columns are defined in the window frame for GROUPS mode or RANGE OFFSET mode, leading to assertion failures or odd errors, as reported by Masahiko Sawada and

pgsql: Fix bugs with degenerate window ORDER BY clauses in GROUPS/RANGE

2018-07-11 Thread Tom Lane
Fix bugs with degenerate window ORDER BY clauses in GROUPS/RANGE mode. nodeWindowAgg.c failed to cope with the possibility that no ordering columns are defined in the window frame for GROUPS mode or RANGE OFFSET mode, leading to assertion failures or odd errors, as reported by Masahiko Sawada and

pgsql: Fix create_scan_plan's handling of sortgrouprefs for physical tl

2018-07-11 Thread Tom Lane
Fix create_scan_plan's handling of sortgrouprefs for physical tlists. We should only run apply_pathtarget_labeling_to_tlist if CP_LABEL_TLIST was specified, because only in that case has use_physical_tlist checked that the labeling will succeed; otherwise we may get an "ORDER/GROUP BY expression n

pgsql: Fix create_scan_plan's handling of sortgrouprefs for physical tl

2018-07-11 Thread Tom Lane
Fix create_scan_plan's handling of sortgrouprefs for physical tlists. We should only run apply_pathtarget_labeling_to_tlist if CP_LABEL_TLIST was specified, because only in that case has use_physical_tlist checked that the labeling will succeed; otherwise we may get an "ORDER/GROUP BY expression n

pgsql: Fix create_scan_plan's handling of sortgrouprefs for physical tl

2018-07-11 Thread Tom Lane
Fix create_scan_plan's handling of sortgrouprefs for physical tlists. We should only run apply_pathtarget_labeling_to_tlist if CP_LABEL_TLIST was specified, because only in that case has use_physical_tlist checked that the labeling will succeed; otherwise we may get an "ORDER/GROUP BY expression n

pgsql: Fix create_scan_plan's handling of sortgrouprefs for physical tl

2018-07-11 Thread Tom Lane
Fix create_scan_plan's handling of sortgrouprefs for physical tlists. We should only run apply_pathtarget_labeling_to_tlist if CP_LABEL_TLIST was specified, because only in that case has use_physical_tlist checked that the labeling will succeed; otherwise we may get an "ORDER/GROUP BY expression n

pgsql: Mark built-in btree comparison functions as leakproof where it's

2018-07-11 Thread Tom Lane
Mark built-in btree comparison functions as leakproof where it's safe. Generally, if the comparison operators for a datatype or pair of datatypes are leakproof, the corresponding btree comparison support function can be considered so as well. But we had not originally worried about marking suppor

Re: Tips on committing

2018-07-11 Thread Peter Geoghegan
On Tue, Jul 10, 2018 at 9:14 PM, Noah Misch wrote: > My rule has been to add to my private checklist anytime I mail or push a patch > containing a readily-checkable mistake. I go through the checklist before > mailing or pushing any patch. It has things in common with your list, plus > these: >

pgsql: Make logical WAL sender report streaming state appropriately

2018-07-11 Thread Michael Paquier
Make logical WAL sender report streaming state appropriately WAL senders sending logically-decoded data fail to properly report in "streaming" state when starting up, hence as long as one extra record is not replayed, such WAL senders would remain in a "catchup" state, which is inconsistent with t

pgsql: Make logical WAL sender report streaming state appropriately

2018-07-11 Thread Michael Paquier
Make logical WAL sender report streaming state appropriately WAL senders sending logically-decoded data fail to properly report in "streaming" state when starting up, hence as long as one extra record is not replayed, such WAL senders would remain in a "catchup" state, which is inconsistent with t

pgsql: Make logical WAL sender report streaming state appropriately

2018-07-11 Thread Michael Paquier
Make logical WAL sender report streaming state appropriately WAL senders sending logically-decoded data fail to properly report in "streaming" state when starting up, hence as long as one extra record is not replayed, such WAL senders would remain in a "catchup" state, which is inconsistent with t

pgsql: Make logical WAL sender report streaming state appropriately

2018-07-11 Thread Michael Paquier
Make logical WAL sender report streaming state appropriately WAL senders sending logically-decoded data fail to properly report in "streaming" state when starting up, hence as long as one extra record is not replayed, such WAL senders would remain in a "catchup" state, which is inconsistent with t

pgsql: Make logical WAL sender report streaming state appropriately

2018-07-11 Thread Michael Paquier
Make logical WAL sender report streaming state appropriately WAL senders sending logically-decoded data fail to properly report in "streaming" state when starting up, hence as long as one extra record is not replayed, such WAL senders would remain in a "catchup" state, which is inconsistent with t

pgsql: Make logical WAL sender report streaming state appropriately

2018-07-11 Thread Michael Paquier
Make logical WAL sender report streaming state appropriately WAL senders sending logically-decoded data fail to properly report in "streaming" state when starting up, hence as long as one extra record is not replayed, such WAL senders would remain in a "catchup" state, which is inconsistent with t

pgsql: Add assertion in expand_vacuum_rel() for non-autovacuum path

2018-07-11 Thread Michael Paquier
Add assertion in expand_vacuum_rel() for non-autovacuum path The code path where the assertion is added helps to check that autovacuum always includes a relation OID when doing a vacuum on it. Extracted from a larger patch set to add support for SKIP LOCKED with manual VACUUM commands. Author: Na

pgsql: Rename VACOPT_NOWAIT to VACOPT_SKIP_LOCKED

2018-07-11 Thread Michael Paquier
Rename VACOPT_NOWAIT to VACOPT_SKIP_LOCKED When it comes to SELECT ... FOR or LOCK, NOWAIT means to not wait for something to happen, and issue an error. SKIP LOCKED means to not wait for something to happen but to move on without issuing an error. The internal option of autovacuum and autoanaly