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

From Alvaro Herrera
Subject Re: Integer input functions for date and timestamp
Date
Msg-id 1287778800-sup-4683@alvh.no-ip.org
Whole thread Raw
In response to Re: Integer input functions for date and timestamp  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Integer input functions for date and timestamp  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Excerpts from Alvaro Herrera's message of vie oct 22 17:13:31 -0300 2010:
> Excerpts from Robert Haas's message of vie oct 22 16:54:01 -0300 2010:
> 
> > 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
> 
> Why do you go through text and concatenation?  I advocate this approach:
>     the_int * interval '1 second'

A quick tests with pgbench custom scripts says that it's about 10%
faster.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Extensions, this time with a patch
Next
From: Robert Haas
Date:
Subject: Re: Integer input functions for date and timestamp