bug fixed for postgres dialect