Segfault on updating foreign table

Started by Lukáš Sobotkaabout 6 years ago2 messagesbugs
Jump to latest
#1Lukáš Sobotka
sobotka.luk@gmail.com

Hi there,

I tried to synchronize two tables on different databases using foreign data
wrapper. I executed update of foreign table with sub-query selection from
local table. As the result I got segmentation fault. General query:
UPDATE foreign_table SET (col) = (
SELECT col
FROM local_table
WHERE foreign_table.id = local_table.id
);

I am not looking for working or better solution, I just want let you know
about this. I think the query is according documentation and segfault is
not suitable result. If somebody could check it I would be grateful.

For reproducer or log see attachments.
Tested on Ubuntu 18.04.3 LTS with PG12: PostgreSQL 12.1 (Ubuntu
12.1-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit

Thanks for your time.

Best regards,
Lukas

Attachments:

postgresql.logtext/x-log; charset=US-ASCII; name=postgresql.logDownload
reproducer.sqlapplication/sql; name=reproducer.sqlDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Lukáš Sobotka (#1)
Re: Segfault on updating foreign table

=?UTF-8?B?THVrw6HFoSBTb2JvdGth?= <sobotka.luk@gmail.com> writes:

I tried to synchronize two tables on different databases using foreign data
wrapper. I executed update of foreign table with sub-query selection from
local table. As the result I got segmentation fault. General query:
UPDATE foreign_table SET (col) = (
SELECT col
FROM local_table
WHERE foreign_table.id = local_table.id
);

Yup, that's a bug. Will fix, thanks for the report!

regards, tom lane