I wrote:
> Abhijit Menon-Sen <ams@2ndQuadrant.com> writes:
>> At 2015-05-27 11:46:39 +0530, ams@2ndQuadrant.com wrote:
>>> I'm trying a couple of approaches to that (e.g. using readdir directly
>>> instead of ReadDir), but other suggestions are welcome.
>> Here's what that looks like, but not yet fully tested.
> I doubt that that (not using AllocateDir) is a good idea in the backend,
Oh, scratch that. Reading the patch closer, I see you kept the use of
AllocateDir and only replaced ReadDir. That's kind of ugly (and certainly
requires a comment about the inconsistency) but it's probably ok from an
error handling standpoint. There are hard failure cases in AllocateDir,
but they seem unlikely to create problems in practice.
The other points stand though ...
regards, tom lane