Windows

From PostgreSQL wiki
Jump to navigationJump to search

A catalogue of pain points on Windows.

Do we really need to pretend Windows has Unixoid symlinks?

Windows has three kinds of links: hard links (we use those via link() in win32link.c), symlinks (a class of reparse points that require unusual privileges so we can't use them) and junction points (another class of reparse points that we do use). We have a lots of code to make junction points appear to be Unix symlinks. This includes symlink(), readlink(), stat(), fstat().

We used symlinks to implement tablespaces on Unix because it was convenient and simple, but it turns out to be inconvenient and unsimple on Windows. So perhaps we should reconsider that, and just create a mapping file instead? Then we could rip out all that symlink emulation code.

Can we get better unlink semantics?

Windows has completely different locking semantics for files. We have a lot of code doing highly questionable sleep-and-retry loops in our wrappers for open(), stat(), rename(), unlink() etc to cope with this. We also have complex code to force all backends to close all file handles at certain times.

According to the testing done in this thread, we could make all of those problems go away if we enabled POSIX-mode unlink behaviour. But then PostgreSQL would only work on NTFS. It would no longer work on SMB (network file system) or ReFS (COW file system). Can we do that?

Do we need to pretend that Windows has Unixoid signals?

XXX say more

Weird socket semantics

XXX say more

Unstable locales

XXX say more