extra work for postgres, fix #338