Accept GenericConnection instead Connection in some Pg-related cases and
rename query building methods.