Re: date - Mailing list pgsql-sql

From Osvaldo Rosário Kussama
Subject Re: date
Date
Msg-id 43ECBA58.3060303@yahoo.com.br
Whole thread Raw
In response to date  ("superboy143 (sent by Nabble.com)" <lists@nabble.com>)
List pgsql-sql
superboy143 (sent by Nabble.com) wrote:

>Hello,
>
>How can I write an sql query in postgresql so that I can insert a date into
>a table in the format DD-MM-YYYY, and when I select the date from the table
>I should get the date in the same format.
>  
>

See postgresql.conf documentation
(http://www.postgresql.org/docs/8.1/interactive/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT):
17. Server Configuration
17.10.2. Locale and Formatting

DateStyle = 'German, dmy'
- output format specification: German
- input/output specification for year/month/day ordering: DMY


postgres=# SHOW datestyle; DateStyle
-------------German, DMY
(1 row)

postgres=# SELECT CURRENT_DATE;   date
------------10.02.2006
(1 row)

postgres=# SELECT to_char('09/03/2005'::date,'dd/mon/yyyy');  to_char
-------------09/mar/2005
(1 row)

[]s
Osvaldo


    
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
http://br.acesso.yahoo.com


pgsql-sql by date:

Previous
From: Ken Hill
Date:
Subject: Re: Deleting rows in a file based on condition
Next
From: Bryce Nesbitt
Date:
Subject: Very slow updates when using IN syntax subselect