citusdata / citusdata/pg_shard

Support STABLE functions in INSERT statements

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
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

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.