Datestyle in postgresql

From MyWiki

Revision as of 20:51, 29 June 2009 by 93.107.9.138 (Talk)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I was in for a surprise last weekend. Was upgrading the server at the local community call centre and stumbled upon the change of datestyle property in PostgreSQL 8.3.

amarkelo@ca-server:~$ grep datestyle /etc/postgresql/8.?/main/postgresql.conf
/etc/postgresql/8.1/main/postgresql.conf:#datestyle = 'iso, mdy'
/etc/postgresql/8.3/main/postgresql.conf:datestyle = 'iso, dmy'

Notice the last bit of the lines. It used to be mdy in 8.1 and it's dmy in 8.3.

So, that taught me a lesson to set the input date style when I open a connection in my software to take care of such a surprise. Have a look at manual here http://www.postgresql.org/docs/8.3/static/sql-set.html.

Personal tools