X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1A984476178 for ; Tue, 6 May 2003 17:20:46 -0400 (EDT) Received: from post.webmailer.de (natsmtp00.webmailer.de [192.67.198.74]) by postgresql.org (Postfix) with ESMTP id 384D9475E4D for ; Tue, 6 May 2003 17:20:35 -0400 (EDT) Received: from iwate.ianb.homelinux.net (pD9E0E855.dip.t-dialin.net [217.224.232.85]) by post.webmailer.de (8.12.8/8.8.7) with ESMTP id h46LKZqU004441; Tue, 6 May 2003 23:20:35 +0200 (MEST) From: Ian Barwick To: Thomas Good , Postgres SQL List Subject: Re: Date Anomaly?? Date: Tue, 6 May 2003 23:19:42 +0200 User-Agent: KMail/1.5.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200305062319.42247.barwick@gmx.net> X-Spam-Status: No, hits=-34.0 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,RCVD_IN_NJABL, RCVD_IN_OSIRUSOFT_COM,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/107 X-Sequence-Number: 13272 On Tuesday 06 May 2003 22:05, Thomas Good wrote: > Hi! > > When I run this from the psql monitor: > > SELECT SUBSTR(CURRENT_DATE - INTERVAL '1 MONTH',0,11); > it returns - 2003-04-06 which is the desired behaviour. > > Inside a CGI/DBI script it returns: > > Sun Apr 06 > > Anyone have any idea what is going on here!? Somewhere the datestyle has been set to "PostgreSQL", probably somewhere in your CGI environment. http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql-set.html Ian Barwick barwick@gmx.net