Misleading error message when shard creation fails in create_distributed_table
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
When something goes wrong during shard creation in `create_distributed_table(...)` we always give a message like `ERROR: table "new_distributed_table" could not be colocated with search`, even when the problem is unrelated to colocation.
Example posted on Slack:
```
postgres=# \d search
Table "public.search"
Column | Type | Modifiers
---------------+-----------------------------+-----------
id | text | not null
timestamp | timestamp without time zone |
query_channel | text |
_extra_props | jsonb |
Indexes:
"idxfinished" btree (((_extra_props -> 'params'::text) ->> 'channelID'::text))
postgres=# \d compressed
Foreign table "public.compressed"
Column | Type | Modifiers | FDW Options
---------------+-----------------------------+-----------+-------------
id | text | not null |
timestamp | timestamp without time zone | |
query_channel | text | |
_extra_props | jsonb | |
Server: cstore_server
FDW Options: (compression 'pglz')
postgres=# SELECT create_distributed_table('compressed', 'query_channel');
WARNING: could not open extension control file "/usr/share/postgresql/9.6/extension/cstore_fdw.control": No such file or directory
ERROR: table "compressed" could not be colocated with search
```
In this case, the problem was that cstore_fdw is not installed on the worker, but the error made it seem like a distributed `cstore_fdw` table could not be colocated with a regular distributed table.
Contributor guide
Assessment
This issue has not been assessed yet.