Beginning with PostgreSQL 11, inserts resulting from a COPY FROM operation or partition tuple routing need to be handled, even if only an error message is raised indicating the functionality is not available.
Without this, a server crash will occur, e.g.:
postgres=# \d my_instest
Foreign table "public.my_instest"
Column | Type | Collation | Nullable | Default | FDW options
--------+-----------------------+-----------+----------+---------+-------------
id | integer | | | |
val | character varying(30) | | | |
Server: mysql_server
FDW options: (dbname 'test', table_name 'instest')
postgres=# COPY my_instest FROM STDIN WITH (format 'csv');
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> 1,foo
2,bar
\.>> >>
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
This patch results in an error being raised:
postgres=# COPY my_instest FROM STDIN WITH (format 'csv');
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> 1,foo
2,bar
\.>> >>
ERROR: COPY and foreign partition routing not supported
Beginning with PostgreSQL 11, inserts resulting from a COPY FROM operation or partition tuple routing need to be handled, even if only an error message is raised indicating the functionality is not available.
Without this, a server crash will occur, e.g.:
This patch results in an error being raised: