ERROR: function to_date(timestamp with time zone, unknown) does not exist
LINE 1: SELECT to_date(now() + '-7day', 'YYYY-MM-DD')
^
********** Error **********
Is there any easy way to maintain compatibility?
You could try creating a user function named "to_date" with (timestamptz, text) as the signature and then inside the function cast the first argument to text explicitly before invoking the built-in to_date(text, text) function and returning its result.
You may have to deal with namespace/search_path issues though...