citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.1k stars 650 forks source link

Reference table creation from a "foreign table" fails in MX #3848

Open onurctirtir opened 4 years ago

onurctirtir commented 4 years ago

Normally citus does not create its truncate trigger when creating a reference table or a distributed table from a "foreign table". However in mx arch., somehow we attempt to create the truncate trigger on the worker node and PostgreSQL fails as below:

SET citus.replication_model TO streaming;
SELECT start_metadata_sync_to_node ('localhost', 9701);
CREATE EXTENSION file_fdw;
CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;
CREATE FOREIGN TABLE pglog_table (a int, b int) server pglog options (filename '/path/to.csv', format 'csv');

SELECT create_reference_table('pglog_table');
ERROR:  "pglog_table" is a foreign table
DETAIL:  Foreign tables cannot have TRUNCATE triggers.
CONTEXT:  while executing command on localhost:9701
onderkalaci commented 4 years ago

related (or same) as https://github.com/citusdata/citus/issues/2312

onurctirtir commented 4 years ago

they look very same