Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

253
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda