Re: Date Anomaly??

Поиск
Список
Период
Сортировка
Искать
От
Thomas Good
Тема
Re: Date Anomaly??
Дата
в 11:02:54
Msg-id
Pine.LNX.4.44.0305071047270.29670-100000@q8.nrnet.org
Ответ на
Список
Дерево обсуждения
Date Anomaly?? Thomas Good <tomg@sqlclinic.net>
Re: Date Anomaly?? Ian Barwick <barwick@gmx.net>
Re: Date Anomaly?? Thomas Good <tomg@sqlclinic.net>
Re: Date Anomaly?? Tom Lane <tgl@sss.pgh.pa.us>
Re: Date Anomaly?? Thomas Good <tomg@sqlclinic.net>
Re: Date Anomaly?? Josh Berkus <josh@agliodbs.com>
Re: Date Anomaly?? Thomas Good <tomg@sqlclinic.net>
Re: Date Anomaly?? Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: Date Anomaly?? Bruno Wolff III <bruno@wolff.to>
Re: Date Anomaly?? Tom Lane <tgl@sss.pgh.pa.us>
On Wed, 7 May 2003, Tom Lane wrote:

> Thomas Good  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 по дате отправления
От: Rado Petrik
Дата:
От: Ries van Twisk
Дата:
Сообщение: array in a reference
FAQ