diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-03-04 11:35:46 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-03-04 11:37:42 -0500 |
commit | 3bea3f88d5fc3517042ba83d2906979256da2442 (patch) | |
tree | 37520f014243fb01ab65adfc3aaaab957519b6d4 /contrib/postgres_fdw/deparse.c | |
parent | 52fe6f4e02f89f6230994988af9abc23b332b83e (diff) |
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.
Diffstat (limited to 'contrib/postgres_fdw/deparse.c')
-rw-r--r-- | contrib/postgres_fdw/deparse.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index ef8eab6c5db..021b764ee98 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -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 = ", "; } |