Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 3E8272E3A5C for ; Thu, 24 Jan 2008 11:46:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 12124-03-3 for ; Thu, 24 Jan 2008 11:45:57 -0400 (AST) Received: from QMTA03.westchester.pa.mail.comcast.net (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) by postgresql.org (Postfix) with ESMTP id 6558C2E3B69 for ; Thu, 24 Jan 2008 11:35:50 -0400 (AST) Received: from OMTA01.westchester.pa.mail.comcast.net ([76.96.62.11]) by QMTA03.westchester.pa.mail.comcast.net with comcast id h0qY1Y00J0EZKEL050GV00; Thu, 24 Jan 2008 15:35:49 +0000 Received: from [192.168.0.26] ([24.17.167.182]) by OMTA01.westchester.pa.mail.comcast.net with comcast id h3bm1Y00J3wT2q03M00000; Thu, 24 Jan 2008 15:35:49 +0000 X-Authority-Analysis: v=1.0 c=1 a=epTmVMiNAAAA:8 a=Pg2QQslHmlUCfccAEdIA:9 a=K5O_Ze-0Ptd2oOc1gxMA:7 a=ZNxnyxi_QtmMvyzBetjUAeZ-gG0A:4 a=si9q_4b84H0A:10 a=LY0hPdMaydYA:10 From: Adrian Klaver To: pgsql-sql@postgresql.org, iuri.sampaio@computer.org Subject: Re: date format Date: Thu, 24 Jan 2008 07:37:09 -0800 User-Agent: KMail/1.9.1 References: <1201162018.7883.12.camel@COMPAQ> In-Reply-To: <1201162018.7883.12.camel@COMPAQ> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801240737.10048.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/182 X-Sequence-Number: 30035 On Thursday 24 January 2008 12:06 am, iuri de araujo sampaio wrote: > hi, > > how to change the default format for type date? > I have created a field on a table: > > ## > create table tbl_inventory ( > item_id integer constraint c_pk primary key, > I. purchase_date date, > II. fabrication_date date, > III. expiration_date date > ); > ## > > the error i got is: > > ## > Database operation "dml" failed > (exception ERROR, "ERROR: invalid input syntax for type date: "2008 7 22 > {} {} {} {DD MONTH YYYY}" ") > ## If this : "2008 7 22 {} {} {} {DD MONTH YYYY}" is indeed the string you are trying to input then it will not work. See- http://www.postgresql.org/docs/8.2/interactive/datatype-datetime.html#DATATYPE-DATETIME-INPUT for valid input types. > > I am concerned the input syntax for type date is YYYY-MM-DD. > as default, postgresql is set to accept the format DD-MM-YYYY for type > date. > > so far, i am not able to change the input format and so I need to change > the postgresql type date dafault format. > > best, > iuri > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match -- Adrian Klaver aklaver@comcast.net