Adding pgsql support based on mysql support