Re: How do I do a dynamic - select now() + interval X days ?

From: Kristo Kaiv <kristo(dot)kaiv(at)skype(dot)net>
To: Jon Sime <jsime(at)mediamatters(dot)org>
Cc: "Abraham, Danny" <danny_abraham(at)bmc(dot)com>, PostgreSQL Admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How do I do a dynamic - select now() + interval X days ?
Date: 2007-08-08 15:24:52
Message-ID: 2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On 08.08.2007, at 18:16, Jon Sime wrote:

> Abraham, Danny wrote:
>> Thanks
>
> For doing that based on an arbitrary value, just do the following:
>
> select now() + interval '1 day' * X;
>
> -Jon
>
test=# select (3||' day')::interval;
interval
----------
3 days
(1 row)

> --
> Senior Systems Developer
> Media Matters for America
> http://mediamatters.org/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

Kristo Kaiv
http://kaiv.wordpress.com (PostgreSQL blog)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Fabricio Peñuelas 2007-08-08 15:32:57 Re: ssl and odbc standar driver
Previous Message Rodrigo De León 2007-08-08 15:19:02 Re: How do I do a dynamic - select now() + interval X days ?