Andrus wrote: > Thank all very much for great suggestions. > > I created function > > CREATE OR REPLACE FUNCTION PUBLIC.GOMONTH(DATE, INTEGER, OUT DATE) > IMMUTABLE > AS > $_$ > SELECT ($1 + ($2 * '1 MONTH'::INTERVAL))::DATE; > $_$ LANGUAGE SQL; > > I got errors: > > function gomonth(date, numeric) does not exist
Why would you want to call the function with a numeric? What does 1.2 months mean to you? You're probably only interested in the integer part of the numeric. > function gomonth(date, bigint ) does not exist Do you really expect to calculate dates over 2 billion months in the future or the past? If you really want to; you can write gomonth versions for numeric and bigint month counts with a body that casts the months value to integer and calls the gomonth(date, integer) version. -- Alban Hertroys [EMAIL PROTECTED] magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede // Integrate Your World // ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend