Re: Oracle-Style Date Functions

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Oracle-Style Date Functions
Дата
Msg-id 200312051115.35047.josh@agliodbs.com
обсуждение исходный текст
Ответ на Oracle-Style Date Functions  (David Rickard <David.Rickard@GTScompanies.com>)
Список pgsql-novice
David,

> Has anyone developed PostgreSQL versions of the Oracle date functions?  I'm
> especially interested in ports of ADD_MONTHS and NEXT_DAY, or hints on
> replicating them in PostgreSQL.

Trivial:

CREATE FUNCTION add_months (timestamp, integer)
RETURNS timestamp AS '
SELECT $1 + (''1 month''::INTERVAL * $2);
' LANGUAGE SQL IMMUTABLE, STRICT;

CREATE FUNCTION NEXT_DAY (timestamp)
RETURNS timestamp AS '
SELCET $1 + ''1 day''::INTERVAL;
' LANGUAGE SQL IMMUTABLE, STRICT;

--
Josh Berkus
Aglio Database Solutions
San Francisco

В списке pgsql-novice по дате отправления:

Предыдущее
От: Sai Hertz And Control Systems
Дата:
Сообщение: Re: Managing users
Следующее
От: "David Benoff"
Дата:
Сообщение: PostgreSQL and ADO.net?