Merge pull request #16649 from Agis-/pg-columns-for-distinct

Fix postgresql adapter #columns_for_distinct trimming whitespace it shouldn't

Conflicts:
	activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
CHANGELOG & improvements to #16649

* Require either FIRST or LAST qualifier for "NULLS ..."
* Require whitespace before "NULLS ..."

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md