From: | Andy Colson <andy(at)squeakycode(dot)net> |
---|---|
To: | DM <dm(dot)aeqa(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: MySQL -> PostgreSQL conversion issue |
Date: | 2011-08-19 13:49:10 |
Message-ID: | 4E4E69D6.4020802@squeakycode.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 8/19/2011 7:50 AM, 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?
>
> thanks
> Deepak
Well.. What is the interval in mysql? Is that supposed to represent +
interval '1970 years' + interval '1 month' + interval '2 days'?
In PG you probably have a few options. One, store it as a date, and use
dateAdd() functions. Two, store it as text and set the value's to
things like '1 hour', '2 years', '70 years 1 month 2 days 4 hours 20
minutes', etc
The calc like 'select someDate + interval yourNewField'
Of course... I have not actually tried any of this :-)
-Andy
From | Date | Subject | |
---|---|---|---|
Next Message | Andy Colson | 2011-08-19 13:55:39 | Re: Getting value of bind variables |
Previous Message | c k | 2011-08-19 13:39:00 | Re: [ADMIN] help in postgresql |