core: fix stored procedure 'medium_update' for psql 8.x