It's like in any sizable codebase with quite some history. There's substantial difference in quality between parts. Some of the worst parts go back to the early days of postgres - the priorities and resources available back then were just very different than today. Obviously there's also noticeable differences in more recent code, but I don't think to the same degree (although there've been definitely subsystems that worked out better and some that worked out worse).
E.g. the code above is essentially (although somewhat mechanically renamed and moved since), from:
commit 41f1f5b76ad8e177a2b19116cbf41384f93f3851
Author: Thomas G. Lockhart <lockhart@fourpalms.org>
Date: 2000-02-16 17:26:26 +0000
Implement "date/time grand unification".
> Usage of acronyms is one of the worst offenders in bad code.
Not really on board with that... It's a balance. Brevity does have it's value too. Everybody is going to understand that TS stands for timestamp, that WAL stands for write ahead log, etc. Especially when dealing with a language that doesn't have namespaces etc, you're going to have to realistically deal with prefixes a good bit. There's plenty of bad abbreviations in postgres code, however, don't get me wrong.
In the above I'm more bothered by the inconsistent naming, which I think is probably one postgres' bigger code quality issues.
> For me, comments should only be needed when something isn't clear.
I pretty strongly disagree. Most of the time comments shouldn't explicitly restate all that code is doing, sure (although there's clearly exceptions to that too). But e.g. stating why an algorithm is doing something, what the higher level goals of some checks are, why some shortcut is reasonable all make a code base a lot more maintainable in the medium to long run.
I work a lot on postres, and occasionally dabble around the corners of linux. For me it's the* defining difference making it much more painful to understand most linux subsystems.
Edit: formatting, typo