small fixes for pgsql