Re: formatting a date when some nulls exist

Поиск
Список
Период
Сортировка
От Eric Walstad
Тема Re: formatting a date when some nulls exist
Дата
Msg-id 3D759734.6020800@walstads.net
обсуждение исходный текст
Ответ на formatting a date when some nulls exist  (Eric Walstad <eric@walstads.net>)
Список pgsql-novice
Tom,

Thanks for your help.  I'll send RH a note.
FWIW, I got around the problem by doing this:
SELECT EXTRACT(YEAR FROM birthday) || '-' || LPAD(EXTRACT(MONTH FROM
birthday), 2, '0') || '-' || LPAD(EXTRACT(DAY FROM birthday), 2, '0') AS
bday FROM ewtest;

Which is really ugly, but works for me for now.

Thanks again,

Eric.

Tom Lane wrote:
> Eric Walstad <eric@walstads.net> writes:
>
>>[ewalstad@uluwatu ewalstad]$ uname -a
>>Linux uluwatu 2.4.18-10 #1 Wed Aug 7 11:39:21 EDT 2002 i686 unknown
>
>
> Ah, you're using the new-and-"improved" glibc.  I'll bet you have dates
> in your table that precede 1/1/1970?  The glibc boys decided (quite
> arbitrarily) that mktime(3) should stop supporting pre-1970 dates, and
> that in turn broke a number of Postgres operations.
>
> I just today committed a fix that works around this problem.  It'll
> be in PG 7.3 if it survives beta testing.  I'm afraid I don't have any
> very good answer for 7.2 ... but do complain to your Linux distributor
> that mktime() is broken.  Because it is, and the glibc authors need to
> hear about it often enough to realize that they made a stupid decision.
>
>             regards, tom lane


В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: formatting a date when some nulls exist
Следующее
От: "Jerome Chochon"
Дата:
Сообщение: PostgreSQL papers: The last time