Re: INTERVAL SECOND limited to 59 seconds?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sebastien FLAESCH <sf(at)4js(dot)com>, PgSql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: INTERVAL SECOND limited to 59 seconds?
Date: 2009-05-19 09:57:28
Message-ID: 4A128288.8090304@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Sebastien FLAESCH wrote:
> Actually it's not limited to the usage of INTERVAL SECOND, I am writing
> a PostgreSQL driver for our 4GL virtual machine...
>
> I need to store all possible Informix INTERVAL types such as:
>
> INTERVAL MONTH(8) TO MONTH
> INTERVAL DAY(8) TO MINUTE
> INTERVAL SECOND TO FRACTION(5)
> ... etc ...
>
> ...
>
> If PostgreSQL is not able to store months > 11, hours > 23 and minutes
> or seconds > 59

Well, it's not storage it's formatting. Doesn't make any difference to
your problem though.

>, it looks like I will need to deal with PostgreSQL's
>
> INTERVAL YEAR TO MONTH
> INTERVAL DAY TO SECOND(5)
>
> ... and make conversions, to store all possible Informix INTERVALs...

If you know a little "C" you could build some custom types to match your
needs. It should just be a matter of applying the correct formatting as
a wrapper around the existing "interval" type.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kelvin273 2009-05-19 10:05:02 Re: my insertion script don't work
Previous Message Sebastien FLAESCH 2009-05-19 09:53:43 Re: INTERVAL SECOND limited to 59 seconds?

Browse pgsql-hackers by date

  From Date Subject
Next Message Sam Mason 2009-05-19 10:09:32 Re: INTERVAL data type and libpq - what format?
Previous Message Sebastien FLAESCH 2009-05-19 09:53:43 Re: INTERVAL SECOND limited to 59 seconds?