1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

postgres_fdw: When sending ORDER BY, always include NULLS FIRST/LAST.

Previously, we included NULLS FIRST when appropriate but relied on the
default behavior to be NULLS LAST.  This is, however, not true for a
sort in descending order and seems like a fragile assumption anyway.

Report by Rajkumar Raghuwanshi.  Patch by Ashutosh Bapat.  Review
comments from Michael Paquier and Tom Lane.
This commit is contained in:
Robert Haas
2016-03-04 11:35:46 -05:00
parent 52fe6f4e02
commit 3bea3f88d5
3 changed files with 125 additions and 31 deletions

View File

@ -2308,6 +2308,8 @@ appendOrderByClause(List *pathkeys, deparse_expr_cxt *context)
if (pathkey->pk_nulls_first)
appendStringInfoString(buf, " NULLS FIRST");
else
appendStringInfoString(buf, " NULLS LAST");
delim = ", ";
}