Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

248
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda