$result =pg_query_params($DBC,"\n\t\t\t\t\t\t\t\t\t\tWITH men_number_tb AS(\nSELECT count(customerid) AS men_number FROM customers WHERE sex='M' AND user_group_id=2\n)\nSELECT round(avg(men_number) / count(customerid), 2) FROM customers, men_number_tb WHERE user_group...
We do this by introducing aformatQueryutility function that interpolates parameters into the query using the Postgresformatfunction. Although it requires an instance of PGlite or a transaction as its first argument I decanted to keep it separate rather than a method on pglite/tx as its an adva...