Re: Date Anomaly?? - Mailing list pgsql-sql

From Thomas Good
Subject Re: Date Anomaly??
Date
Msg-id Pine.LNX.4.44.0305071047270.29670-100000@q8.nrnet.org
Whole thread Raw
In response to Re: Date Anomaly??  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Date Anomaly??  (Josh Berkus <josh@agliodbs.com>)
Re: Date Anomaly??  (Bruno Wolff III <bruno@wolff.to>)
Re: Date Anomaly??  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Date Anomaly??  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Wed, 7 May 2003, Tom Lane wrote:

> Thomas Good <tomg@sqlclinic.net> writes:
> > Another item: if I say 'export PGDATESTYLE=US' and ask psql for
> > the date I get back an ISO date (YYYY-MM-DD).  What region of this
> > US is this, I wonder?  Must be San Francisco (maybe Josh knows ;-)
>
> That's only setting a substyle --- one that's not relevant to the ISO
> major style (at least not on output).  See the SET reference page.

Tom,

So the closest approximation to the default "postgres[ql]" date style
of MM-DD-YYYY (note delimiters) is: SQL,US which returns a
MM/DD/YYYY 00:00:00 value when doing some date arithmetic?

Have I got it right?  Egads...in addition to calling substr() to lose
the 00:00:00 (not terribly useful in this context)  I'll have to
call perl's binding operator (=~) to swap in hyphens as delimiters.

Bottom line: there is no way to return a MM-DD-YYYY value?

I never realised that the morphology of the traditional Postgres date
was this complex (its declension was not apparent until I used the
INTERVAL keyword) and so I've conditioned my users to using hyphens
as delimiters...argh.  Should have used slashes I suppose.

Oh well.  Thanks for the help.

-----------------------------------------------------------------------
Thomas Good                                  e-mail: tomg@sqlclinic.net
Programmer/Analyst                           phone:   (+1) 718.818.5528
Residential Services                         fax:     (+1) 718.818.5056
Behavioral Health Services, SVCMC-NY         mobile:  (+1) 917.282.7359

// Das ist die Kunst - wie man alles verhunzt.



pgsql-sql by date:

Previous
From: Rado Petrik
Date:
Subject: ERROR:  pg_atoi: error in "NULL": can't parse "NULL"
Next
From: "Ries van Twisk"
Date:
Subject: array in a reference