Alternative for execute statement with variant parameters for postgres