Re: MySQL -> PostgreSQL conversion issue

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: MySQL -> PostgreSQL conversion issue
Дата
Msg-id 32FE65F5-BDF4-48AF-8785-CD723C3789CC@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на MySQL -> PostgreSQL conversion issue  (DM <dm.aeqa@gmail.com>)
Ответы Re: MySQL -> PostgreSQL conversion issue  (DM <dm.aeqa@gmail.com>)
Список pgsql-general
On 19 Aug 2011, at 14:50, DM wrote:

> Hi All,
>
> how to insert mysql (datetime interval) data to postgrres interval datatype.
>
> mysql
>  | test_interval   | datetime     | YES  |     | 1970-01-02 00:00:00 |                |
>
> psql
>  test_interval   | interval               |
>
>
> any solution for this?

I think you want something like this?:

development=> select '1970-01-02 00:00:00'::timestamp without time zone - '1970-01-01 00:00:00'::timestamp without time
zone;
 ?column?
 ----------
 1 day(1 row)

Midnight 1970-01-01 being the baseline for their calculations is a bit of a guess, but that seems to make sense with
theexample you gave. 
You probably don't want postgres to be smart with your client's time zone settings, hence the "without time zone".

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4e4eadd712091047328385!



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

Предыдущее
От: Diego Augusto Molina
Дата:
Сообщение: Dump database roles for full restoration
Следующее
От: Edoardo Panfili
Дата:
Сообщение: A questions on planner choices