Search Postgresql Archives

Re: Is there a better way to do this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux