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.