[3.8] Add option to dump SQL queries in stderr