PostgreSQL's fsync() surprise
PostgreSQL's fsync() surprise
Posted Feb 19, 2019 22:39 UTC (Tue) by nybble41 (subscriber, #55106)In reply to: PostgreSQL's fsync() surprise by dvdeug
Parent article: PostgreSQL's fsync() surprise
It's not a matter of either/or. Programs should be both portable *and* useful.
> A user can expect that qsort sorts, but can they expect that it does so reasonably quickly? How often can you call fsync to maintain a reasonable balance between speed and safety? That's never going to be defined by the standard...
Why not? Standards do sometimes specify things like algorithmic complexity. C doesn't specify that for qsort(), unfortunately, but C++ does require std::sort() to be O(n log n) in the number of comparisons. What constitutes a "reasonable balance" is up to the user, but there is no reason in principle why there couldn't be a standard for "filesystems useable with PostgreSQL" which defines similar timing requirements for fsync().