pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Fatih Cerit <fatih@intersan.com.tr>
Cc: pgsql-sql@postgresql.org
Subject: Re: interval +variable
Date: Wed, 9 Mar 2005 08:19:08 -0600
Message-ID: <20050309141908.GA32013@wolff.to> (raw)
In-Reply-To: <008a01c52486$1c1c9520$bb41ccd5@cerit>
References: <008a01c52486$1c1c9520$bb41ccd5@cerit>

On Wed, Mar 09, 2005 at 10:58:05 +0200,
  Fatih Cerit <fatih@intersan.com.tr> wrote:
> Dear all
> 
> Is there anyone at there who knows howto use dateadd in pgsql. I have a 
> problem in my function that is like this ;
> 
> Select into futuredate now() + interval '30 days';  <- this is ok
> but how can I use a variable intead of '30 days'    :(

A better solution may to be to use the date type instead of the timestamp type.
Then you can just add an integer number to the date. You also don't have
to worry about daylight savings time changes.



view thread (3+ messages)

Message-ID: <20050309141908.GA32013@wolff.to>
Permalink:  ../20050309141908.GA32013@wolff.to/
Also on:    postgresql.org/message-id/20050309141908.GA32013@wolff.to

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, fatih@intersan.com.tr
  Subject: Re: interval +variable
  In-Reply-To: <20050309141908.GA32013@wolff.to>

* 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