Skip site navigation (1) Skip section navigation (2)

Re: Is there a better way to do this?

From: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>
To: Wei Weng <wweng(at)kencast(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a better way to do this?
Date: 2007-08-28 21:55:47
Message-ID: 46D499E3.504@lorenso.com (view raw or flat)
Thread:
Lists: pgsql-general
Wei Weng wrote:
> I want to implement something like the following:
> CREATE OR REPLACE FUNCTION AddDays

You don't know how many seconds are in a day, so just add the days using 
SQL.

	RETURN time + (days || ' days')::INTERVAL;

You don't even need to make that a function, just do that you your SQL 
directly.

-- Dante

In response to

Responses

pgsql-general by date

Next:From: Michael GlaesemannDate: 2007-08-28 21:58:17
Subject: Re: Is there a better way to do this?
Previous:From: Rodrigo De LeónDate: 2007-08-28 21:54:50
Subject: Re: Is there a better way to do this?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group