mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 11:03:36 +08:00
Data node scan doesn't support system columns: move this check to an appropriate place
Before, we would complain that we don't support fetching the system columns with per-data node queries enabled, but still execute the code that fetches it. Don't do this and complain earlier.
This commit is contained in:
parent
a064fd3b48
commit
ff945a7a94
@ -66,15 +66,6 @@ data_node_scan_next(CustomScanState *node)
|
||||
slot = fdw_scan_iterate(&node->ss, &sss->fsstate);
|
||||
MemoryContextSwitchTo(oldcontext);
|
||||
|
||||
/* Raise an error when system column is requsted, eg. tableoid */
|
||||
if (sss->systemcol && !TupIsNull(slot))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("system columns are not accessible on distributed hypertables with current "
|
||||
"settings"),
|
||||
errhint("Set timescaledb.enable_per_data_node_queries=false to query system "
|
||||
"columns.")));
|
||||
|
||||
return slot;
|
||||
}
|
||||
|
||||
|
@ -634,6 +634,15 @@ data_node_scan_plan_create(PlannerInfo *root, RelOptInfo *rel, CustomPath *best_
|
||||
bms_free(attrs_used);
|
||||
}
|
||||
|
||||
/* Raise an error when system column is requsted, eg. tableoid */
|
||||
if (scaninfo.systemcol)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("system columns are not accessible on distributed hypertables with current "
|
||||
"settings"),
|
||||
errhint("Set timescaledb.enable_per_data_node_queries=false to query system "
|
||||
"columns.")));
|
||||
|
||||
/* Should have determined the fetcher type by now. */
|
||||
Assert(ts_data_node_fetcher_scan_type != AutoFetcherType);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user