PG: Fix tablespaces in functions