Re: Script errors on run

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Script errors on run
Дата
Msg-id 20080604152637.Q81896@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: Script errors on run  (Ralph Smith <smithrn@washington.edu>)
Ответы Re: Script errors on run  (Ralph Smith <smithrn@washington.edu>)
Список pgsql-general
On Wed, 4 Jun 2008, Ralph Smith wrote:

>    date_string := to_date(year||'-'||month||'-'||day , 'YYYY-MM-DD') ;
>    RAISE INFO 'date_string =  %', date_string ;
>    good_date := to_timestamp(date_string, 'YYYY-MM-DD') ;
>    RAISE INFO 'good_date =  %', good_date ;

This seems like alot of extra work, due to the implicit cast from date to
timestamp. I think
 good_date := to_date(year || '-' || month || '-' || day, 'YYYY-MM-DD')
might work and just be simpler.

>    UsecsD := EXTRACT(EPOCH FROM TIMESTAMP 'good_date') ;

If good_date's already a timestamp, I think this should just be:
 EXTRACT(EPOCH FROM good_date)

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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: functions, transactions, key violations
Следующее
От: Tom Lane
Дата:
Сообщение: Re: functions, transactions, key violations