Marcos Fabrício Corso escreveu:
> Como alterar o formato da data no postgres 8.1 para dd/mm/aaaa ??
>
bdteste=# SELECT current_date;
date
------------
2006-10-20
(1 registro)
bdteste=# SELECT current_setting('datestyle');
current_setting
-----------------
ISO, MDY
(1 registro)
1. Usar a função to_char:
bdteste=# SELECT to_char(current_date,'DD/MM/YYYY');
to_char
------------
20/10/2006
(1 registro)
http://www.postgresql.org/docs/8.1/interactive/functions-formatting.html
Tabela 9-21. Template Patterns for Date/Time Formatting
2. Alterar o parâmetro "datestyle":
bdteste=# SET datestyle TO German, DMY;
SET
bdteste=# SELECT current_date;
date
------------
20.10.2006
(1 registro)
3. Alterar de forma definitiva o datestyle no postgresql.conf, veja:
http://www.postgresql.org/docs/8.1/interactive/runtime-config-client.html
17.10.2. Locale and Formatting
[]s
Osvaldo
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale
o discador agora!
http://br.acesso.yahoo.com
_______________________________________________
Grupo de Usuários do PostgreSQL no Brasil
Antes de perguntar consulte o manual
http://pgdocptbr.sourceforge.net/
Para editar suas opções ou sair da lista acesse a página da lista em:
http://pgfoundry.org/mailman/listinfo/brasil-usuarios