Home > front end >  PostgreSQL 12 ignoring datestyle setting in the postgresql.conf
PostgreSQL 12 ignoring datestyle setting in the postgresql.conf

Time:03-23

I can not set the German datestyle format in Postgres (or any other than ISO).

I have set datestyle = 'German' in postgresql.conf and restarted the service and still show datestyle; reports 'ISO, DMY'.

Tried on:

  • Ubuntu 20, Postgres 12
  • Windows 10, Postgres 13

Also tried datestyle = 'SQL' with the same effect, still 'ISO, DMY'.

Tried ALTER DATABASE database_name SET datestyle TO "German";, even restarted - also does not work. The only thing working is per session statement set datestyle='german' but I want to change it permanently.

What am I missing?

CodePudding user response:

The setting in postgresql.conf must be overridden somewhere. Look at pg_settings:

SELECT setting, source, sourcefile, sourceline
FROM pg_settings
WHERE name = 'DateStyle';

The source column will tell you where your setting comes from. Perhaps your client overrides the server setting.

  • Related