pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmx.net>
To: Thomas Good <tomg@sqlclinic.net>
To: Postgres SQL List <pgsql-sql@postgresql.org>
Subject: Re: Date Anomaly??
Date: Tue, 6 May 2003 23:19:42 +0200
Message-ID: <200305062319.42247.barwick@gmx.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0305061603070.9996-100000@q8.nrnet.org>
References: <Pine.LNX.4.44.0305061603070.9996-100000@q8.nrnet.org>

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




view thread (10+ messages)  latest in thread

Message-ID: <200305062319.42247.barwick@gmx.net>
Permalink:  ../200305062319.42247.barwick@gmx.net/
Also on:    postgresql.org/message-id/200305062319.42247.barwick@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barwick@gmx.net, tomg@sqlclinic.net
  Subject: Re: Date Anomaly??
  In-Reply-To: <200305062319.42247.barwick@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox