citusdata / citusdata/pg_shard
Support STABLE functions in INSERT statements
Open
feature
- Dominant language
- C
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
We took a conservative approach in function evaluation for `INSERT`: we evaluate immutable expressions (such as `2 + 2` or `char_length('postgres')`) during planning but reject any other expressions.
This means certain idioms (like using `now()` to timestamp a row) are unavailable when using `pg_shard`. The next logical step would be to coerce `STABLE` functions into constants during `INSERT`: evaluating them on the master would ensure all replicas receive an identical value.
Contributor guide
Assessment
This issue has not been assessed yet.