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

relates to

Activity

Carlos Ruiz 
September 21, 2020 at 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

Martin Schönbeck 
September 21, 2020 at 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 
August 21, 2020 at 9:53 AM

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 21, 2020 at 9:44 AM
Updated November 1, 2020 at 4:09 PM
Resolved September 21, 2020 at 9:25 AM