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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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