Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails

From: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails
Date: 2021-03-03 08:41:49
Message-ID: 161476090989.29967.7097745522340560681.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: not tested
Documentation: tested, passed

Greetings,
I learned about the patch and read your discussions. I'm not sure why this patch has not been discussed now. In short, I think it's beneficial to submit it as a temporary solution.
Another thing I want to know is whether these codes can be simplified:
- if (state > outer_cxt->state)
+ if (collation == outer_cxt->collation &&
+ ((state == FDW_COLLATE_UNSAFE &&
+ outer_cxt->state == FDW_COLLATE_SAFE) ||
+ (state == FDW_COLLATE_SAFE &&
+ outer_cxt->state == FDW_COLLATE_UNSAFE)))
+ {
+ outer_cxt->state = FDW_COLLATE_SAFE;
+ }
+ else if (state > outer_cxt->state)

If the state is determined by the collation, when the collations are equal, do we just need to judge the state not equal to FDW_COLLATE_NONE?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Steele 2021-03-03 11:49:02 Re: BUG #16894: PANIC: WAL contains references to invalid pages
Previous Message Michael Paquier 2021-03-03 07:03:52 Re: BUG #16894: PANIC: WAL contains references to invalid pages

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2021-03-03 08:44:15 Re: We should stop telling users to "vacuum that database in single-user mode"
Previous Message Andrey Lepikhov 2021-03-03 08:29:12 Increase value of OUTER_VAR