Re: INTERVAL SECOND limited to 59 seconds?

From: Scott Bailey <artacus(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: INTERVAL SECOND limited to 59 seconds?
Date: 2009-05-20 06:42:27
Message-ID: 4A13A653.8090702@comcast.net
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)

In Postgres, you should just store it as an INTERVAL which (unlike some
other RDBMS') has the ability to store ranges from fractional seconds to
thousands of years. Then if you need to output it in the above format,
make a view that splits the actual interval into month, minute and
fractional second pieces.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Guettler 2009-05-20 06:53:55 Re: Get block of N numbers from sequence
Previous Message denis punnoose 2009-05-20 05:25:08 Re: origins/destinations

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-05-20 08:14:19 Re: Multiple sorts in a query
Previous Message Merlin Moncure 2009-05-20 01:42:12 Re: plpgsql + named parameters