citusdata / citusdata/citus

EXPLAIN EXECUTE doesn't support coordinator INSERT/SELECT with parametrized SELECT.

Open
#4,075 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

```sql
CREATE TABLE simple (id integer, name text);
SELECT create_distributed_table('simple', 'id');
PREPARE insert_via_coordinator AS INSERT INTO simple SELECT count(*), name FROM simple WHERE name IN ($1, $2) GROUP BY name;
EXPLAIN EXECUTE insert_via_coordinator('x', 'y');
```

produces the following error:

```
ERROR: could not create distributed plan
DETAIL: Possibly this is caused by the use of parameters in SQL functions, which is not supported in Citus.
HINT: Consider using PL/pgSQL functions instead.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.