Don't trim excess whitespace in columns_for_distinct in pg

Includes test from #16649
Is it safe to mutate `s` here? It doesn't sound like it.