3

Two weeks ago, I installed Ubuntu 18.04 in the Windows Subsystem for Linux.

In there, I installed PostgreSQL 11 using:

sudo apt-get install postgresql-11

At the time, I could start my PostgreSQL using this command:

sudo -u postgres /usr/lib/postgresql/11/bin/pg_ctl -D /etc/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log start

So far so good.

Two weeks later, I try to start this PostgreSQL engine using the same command and I get this error:

"FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory"

I created that folder and gave it chmod 777 to avoid permission problems.

Then I get:

LOG:  database system was interrupted; last known up at 2019-02-16 17:57:02 STD
PANIC:  could not flush dirty data: Function not implemented
LOG:  startup process (PID 94) was terminated by signal 6: Aborted

Any idea what might be wrong?

1 Answer 1

5

There have been recent changes in PostgreSQL related to fsync that turn out to be problematic with the Windows Linux Subsystem. The specific PANIC error you mention is currently discussed on the PG mailing list, with a proposed patch:

WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2

Note that the workaround suggested in the subject, turning fsync to off, is not for production use. It's only okay if you're playing around with Postgres on WSL, and don't really care about the durability of your data. Some say that WSL itself is not for production use anyway.

The fact that /var/run/postgresql does not exist is completely unrelated. /var/run is typically mounted on a RAM disk and is created by the startup scripts that you're side-stepping by using your manual launch procedure. The typical normal procedure is something like systemctl start postgresql, which works when everything is configured normally, and takes care of creating this directory with the proper permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .