postgresql/src/backend/storage
Tom Lane 1d96c1b91a Fix incorrect ordering of operations in pg_resetwal and pg_rewind.
Commit c37b3d08c dropped its added GetDataDirectoryCreatePerm call into
the wrong place in pg_resetwal.c, namely after the chdir to DataDir.
That broke invocations using a relative path, as reported by Tushar Ahuja.
We could have left it where it was and changed the argument to be ".",
but that'd result in a rather confusing error message in event of a
failure, so re-ordering seems like a better solution.

Similarly reorder operations in pg_rewind.c.  The issue there is that
it doesn't seem like a good idea to do any actual operations before the
not-root check (on Unix) or the restricted token acquisition (on Windows).
I don't know that this is an actual bug, but I'm definitely not convinced
that it isn't, either.

Assorted other code review for c37b3d08c and da9b580d8: fix some
misspelled or otherwise badly worded comments, put the #include for
<sys/stat.h> where it actually belongs, etc.

Discussion: https://postgr.es/m/aeb9c3a7-3c3f-a57f-1a18-c8d4fcdc2a1f@enterprisedb.com
2018-05-23 10:59:55 -04:00
..
buffer Remove dubious micro-optimization in ckpt_buforder_comparator(). 2018-01-10 15:50:54 -05:00
file Fix incorrect ordering of operations in pg_resetwal and pg_rewind. 2018-05-23 10:59:55 -04:00
freespace Remove unnecessary BufferGetPage() calls in fsm_vacuum_page(). 2018-03-29 12:44:19 -04:00
ipc Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
large_object Update copyright for 2018 2018-01-02 23:30:12 -05:00
lmgr Re-think predicate locking on GIN indexes. 2018-05-04 11:27:50 +03:00
page Revert "Allow on-line enabling and disabling of data checksums" 2018-04-09 19:03:42 +02:00
smgr Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00