Skip to content

Commit 125f0fd

Browse files
author
Rafa de la Torre
committed
Fix collation in other instances (to be reviewed)
1 parent 6fe4734 commit 125f0fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/postgres_fdw/deparse.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ foreign_expr_walker(Node *node,
466466
* If function's input collation is not derived from a foreign
467467
* Var, it can't be sent to remote.
468468
*/
469-
if (fe->inputcollid == InvalidOid)
469+
if (fe->inputcollid == InvalidOid || inner_cxt.state == FDW_COLLATE_NONE)
470470
/* OK, inputs are all noncollatable */ ;
471471
else if (inner_cxt.state != FDW_COLLATE_SAFE ||
472472
fe->inputcollid != inner_cxt.collation)
@@ -514,7 +514,7 @@ foreign_expr_walker(Node *node,
514514
* If operator's input collation is not derived from a foreign
515515
* Var, it can't be sent to remote.
516516
*/
517-
if (oe->inputcollid == InvalidOid)
517+
if (oe->inputcollid == InvalidOid || inner_cxt.state == FDW_COLLATE_NONE)
518518
/* OK, inputs are all noncollatable */ ;
519519
else if (inner_cxt.state != FDW_COLLATE_SAFE ||
520520
oe->inputcollid != inner_cxt.collation)
@@ -554,7 +554,7 @@ foreign_expr_walker(Node *node,
554554
* If operator's input collation is not derived from a foreign
555555
* Var, it can't be sent to remote.
556556
*/
557-
if (oe->inputcollid == InvalidOid)
557+
if (oe->inputcollid == InvalidOid || inner_cxt.state == FDW_COLLATE_NONE)
558558
/* OK, inputs are all noncollatable */ ;
559559
else if (inner_cxt.state != FDW_COLLATE_SAFE ||
560560
oe->inputcollid != inner_cxt.collation)

0 commit comments

Comments
 (0)