11

I'm trying to create a new database on postgres, by running command:

CREATE DATABASE dbname;

and I face the error:

WARNING: could not flush dirty data: Function not implemented

many times! and finally I get the message

CREATE DATABASE

Can anyone help me to undrestand and solve this error please?

kometen
  • 6,536
  • 6
  • 41
  • 51
Someone
  • 163
  • 1
  • 3
  • 13
  • 1
    Which specific version of PostgreSQL are you using? Which OS? – joanolo Aug 01 '17 at 12:32
  • pgsql 9.6.3 on WindowsBashLinux (which has linux 16.04 on it) – Someone Aug 01 '17 at 12:48
  • 1
    Apparently, you're not the only one with this issue: [install postgresql issue #61](https://github.com/Microsoft/BashOnWindows/issues/61) and [Running Docker containers on Windows, natively, using rkt (WSL aka Bash on Windows)](https://gist.github.com/drdaeman/84f10a7b9da9d2fe152e36b426bde00d). It seems to be some kind of "missing feature" – joanolo Aug 01 '17 at 12:53

4 Answers4

16

I solved the problem by updating postgresql.conf file. Add the following codes at the end of /etc/postgresql/11/main/postgresql.conf.

fsync = off
data_sync_retry = true

(Corrected underscores)

Community
  • 1
  • 1
Oni
  • 1,093
  • 11
  • 16
  • 1
    You may get the same error after fixing issue and starting app again. Restart the postgresql service again at the moment. `sudo service postgresql restart` – Oni Oct 30 '19 at 09:09
2

You need Windows 15025 build for it to function properly, as underlying ubuntu in windows was still in beta before. Even after this build there are still issues remaining.

If update is not yet available to you you can still install Postgres directly on Windows

iklinac
  • 14,944
  • 4
  • 28
  • 30
1

The reason for this error is that the Windows emulation of Linux does not implement all system calls required to make a database work reliably. Originally PostgreSQL crashed when running there, but this has been downgraded to a warning.

Window's emulation of Linux is good to play with, but don't ever use it for serious work.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
0

Restarting the postgres sql did the trick for me

Use the following command

sudo service postgresql restart
Peter Csala
  • 17,736
  • 16
  • 35
  • 75