Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
My application doesn't seem to understand PostgreSQL datestytle settings

I have a PostgreSQL database with datestyle set to "german,dmy" and it works fine on psql. However, when my application tries to retrieve dates from this database (using unixODBC driver) these dates "arrive" in "iso" style...

Could it be caused by driver? Is there something I should do on unixODBC in order to retrieve dates in the same format set to the database?

Thanks in advance.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

you can try setting default datestyle for the user:

so=# alter user tt set datestyle to 'german,dmy';
ALTER ROLE
so=# select now();
              now
-------------------------------
 2017-04-24 21:33:53.653813+01
(1 row)

so=# show datestyle;
 DateStyle
-----------
 ISO, MDY
(1 row)

so=# \q

Now connect with user tt:

MacBook-Air:~ vao$ psql so -U tt
psql (9.6.1)
Type "help" for help.

so=> select now();
              now
--------------------------------
 24.04.2017 21:34:03.874708 IST
(1 row)

so=> show datestyle;
  DateStyle
-------------
 German, DMY
(1 row)

If it does not help, ODBC actively sets datestyle itself. If does, you have same in .psqlrc for style German...

Also check the advanced tab of ODBC datasource

InitializationString=set datestyle to "german,dmy"

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!