Re: More straight forward method to convert seconds::bigint to interval - Mailing list pgsql-general

From Tom Lane
Subject Re: More straight forward method to convert seconds::bigint to interval
Date
Msg-id 7350.1253738484@sss.pgh.pa.us
Whole thread Raw
In response to More straight forward method to convert seconds::bigint to interval  ("Shane R. Spencer" <shane@bogomip.com>)
List pgsql-general
"Shane R. Spencer" <shane@bogomip.com> writes:
> Is there a less string oriented method of converting seconds as an int
> to an interval?

Multiply by an interval, eg

    123456.789 * interval '1 second'

It works, it's fast, and you can use any scale factor you want.

            regards, tom lane

pgsql-general by date:

Previous
From: "Shane R. Spencer"
Date:
Subject: More straight forward method to convert seconds::bigint to interval
Next
From: Adam Rich
Date:
Subject: Re: More straight forward method to convert seconds::bigint to interval