Re: Integer input functions for date and timestamp - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Integer input functions for date and timestamp
Date
Msg-id 29164.1287781842@sss.pgh.pa.us
Whole thread Raw
In response to Re: Integer input functions for date and timestamp  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Ooh, I like it.  A related personal pet peeve of mine: AFAIK the
> easiest way to convert from an integer number of seconds to an
> interval representing that many seconds is:

> (the_int || ' s')::interval

No, the standard solution is
the_int * '1 second'::interval

which is fast and adapts readily to different units for the interval
number.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extensions, this time with a patch
Next
From: Greg Smith
Date:
Subject: Re: ask for review of MERGE