Fix add_months and adddays functions

Description

add_months function in postgresql is not consistent with its oracle version - it truncates the date meanwhile the oracle version doesn't.

On a similar line, the adddays function is expected to behave same in oracle vs postgresql, and expected to behave similar to add_months.
So, no truncation must happen. Furthermore, the oracle function is capable of managing adding partial days (for example to add hours) while the postgres version doesn't.

Also, found the subtractdays in postgresql are not defined as immutable (performance improvement).

Environment

None

Activity

Show:
Carlos Ruiz
August 21, 2020, 9:53 AM

This ticket is a prerequisite for

Martin Schönbeck
September 21, 2020, 9:22 AM
Edited

when applying the postgres script I got problems, because an operator which gets to be deleted is used in a view. Better would be to create or replace instead of deleting and creating.

see https://groups.google.com/g/idempiere/c/brmKFfnfEqA

Regards,
Martin

Carlos Ruiz
September 21, 2020, 9:25 AM

Hi , I think it must be a custom view, you need to delete it before and recreate it after the script is executed.

There is no "CREATE OR REPLACE" way.

Regards,

Carlos Ruiz

Assignee

Carlos Ruiz

Reporter

Carlos Ruiz

Labels

None

Tested By

None

Fix versions

Priority

Major
Configure