pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kristo Kaiv <kristo.kaiv@skype.net>
To: Jon Sime <jsime@mediamatters.org>
Cc: Abraham, Danny <danny_abraham@bmc.com>
Cc: PostgreSQL Admin <pgsql-admin@postgresql.org>
Subject: Re: How do I do a dynamic - select now() + interval X days ?
Date: Wed, 8 Aug 2007 18:24:52 +0300
Message-ID: <2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net> (raw)
In-Reply-To: <46B9DE39.2030608@mediamatters.org>
References: <F8B9B12641FB6B4FAC761BDEF9D63B040E15A690@tlv-ex-01.adprod.bmc.com>
	<46B9DE39.2030608@mediamatters.org>


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)

view thread (4+ messages)

Message-ID: <2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net>
Permalink:  ../2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net/
Also on:    postgresql.org/message-id/2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: kristo.kaiv@skype.net, jsime@mediamatters.org, danny_abraham@bmc.com
  Subject: Re: How do I do a dynamic - select now() + interval X days ?
  In-Reply-To: <2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net>
  References: <F8B9B12641FB6B4FAC761BDEF9D63B040E15A690@tlv-ex-01.adprod.bmc.com> <46B9DE39.2030608@mediamatters.org> <2B704E31-B533-4159-B6F0-EC284CFE824C@skype.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox