X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 83FA59DCA60 for ; Fri, 10 Feb 2006 15:47:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88862-05 for ; Fri, 10 Feb 2006 15:47:43 -0400 (AST) X-Greylist: delayed 01:02:09.035094 by SQLgrey- Received: from smtp102.mail.mud.yahoo.com (smtp102.mail.mud.yahoo.com [209.191.85.212]) by postgresql.org (Postfix) with SMTP id 01D299DCA51 for ; Fri, 10 Feb 2006 15:47:38 -0400 (AST) Received: (qmail 98394 invoked from network); 10 Feb 2006 17:53:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=l2+5J9yAy5jx2IyANd492aDuza2CFvqJRTpbX452nq6cpPm8KovdfbOQ+sWZGLewutBf1HFL+T41ydj5eDSN1XIeYgEfA56SuTODgUyQM2vUh+NxTuXwuzz1YkGJcxMZKDZ5R591nVxm0rqemjd+1fZyoLvgHuhTenVpfoeBeZM= ; Received: from unknown (HELO yahoo.com.br) (osvaldo?kussama@201.51.24.14 with plain) by smtp102.mail.mud.yahoo.com with SMTP; 10 Feb 2006 17:53:07 -0000 Message-ID: <43ECBA58.3060303@yahoo.com.br> Date: Fri, 10 Feb 2006 16:07:52 +0000 From: =?ISO-8859-1?Q?Osvaldo_Ros=E1rio_Kussama?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org, superboy143@gmail.com Subject: Re: date References: <2865031.post@talk.nabble.com> In-Reply-To: <2865031.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.993 required=5 tests=[AWL=0.514, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.993 X-Spam-Level: X-Archive-Number: 200602/118 X-Sequence-Number: 24128 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