Summary:
This revision ports postgres_fdw tests to `yb.port.postgres_fdw.sql`, bringing it up to date with e99df6f4d97e5c002d3c4b89c74a778ad0ac0932 (upstream PG `50d3d22baba63613d1f1406b2ed460dc9b03c3fc`).
== Differences ==
Most differences (non-exhaustive) in test output between vanilla postgres and YB are accounted by the following:
- The planner does not use Index-only Scans to execute scans that only involve primary key columns.
- Due to differences in costs of various join types, the planner sometimes chooses a different join type.
- Due to differences in sort cost, there are differences in when the planner chooses to push down the sort (to the foreign server).
- DML queries having a RETURNING clause will always fetch the ybctid as part of the returning list from the foreign table ([#27762](https://github.com/yugabyte/yugabyte-db/issues/27762)).
== Bugs Found ==
- [#28150](https://github.com/yugabyte/yugabyte-db/issues/28150) - Truncate fails on partitioned table with foreign partitions
- [#28151](https://github.com/yugabyte/yugabyte-db/issues/28151) - Join fails on foreign table having inherited children
- [#28152](https://github.com/yugabyte/yugabyte-db/issues/28152) - ALTER TABLE .. DETACH PARTITION .. CONCURRENTLY crashes
Jira: DB-13185
Test Plan:
Run the following test:
```
./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressContribPostgresFdw#schedule'
```
The difference in output between vanilla PG and the YB port can be analyzed using:
```
<diff-tool> /path/to/yugabyte-db/src/postgres/contrib/postgres_fdw/expected/postgres_fdw.out /path/to/yugabyte-db/src/postgres/contrib/postgres_fdw/expected/yb.port.postgres_fdw.out
```
Reviewers: fizaa
Reviewed By: fizaa
Subscribers: jason, smishra, yql
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D42675