pgsql-bugs@postgresql.org writes:
> Optimalisation options change query results
SQL92 says
Whether a sort key value that is null is considered greater
or less than a non-null value is implementation-defined, but
all sort key values that are null shall either be considered
greater than all non-null values or be considered less than
all non-null values.
Postgres appears to me to satisfy the spec. There's nothing here that
says we can't choose different NULL treatments in different queries...
regards, tom lane