UPDATE/DELETE with timestampz typecast (Stable functions) error out
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
Below is the error and the error message: (Could be related to another issue, but just created this one because what I understand is that when using master_modify_multiple_shards, the DML runs on all shards one by one, could the stable function issue skipped in this case?, I may be wrong in the implementation details)
```
SELECT master_modify_multiple_shards('DELETE FROM test_table_1 WHERE timebucket_start = ''2016-10-26T14:00:00+00:00''::timestamptz')
ERROR: STABLE functions used in UPDATE queries cannot be called with column references
```
Error message also doesn't match the DELETE DML.
Ran during a prospect engagement.
Workaround: Remove the typecast and it works.
```
SELECT master_modify_multiple_shards('DELETE FROM test_table_1 WHERE timebucket_start = ''2016-10-26T14:00:00+00:00''');;
```
Was a difficult workaround to impose at the ORM level(psycopg2), because the application generated the timestampz type cast via an api call. Had to manually update the sql string which the api generated and then made it work.
Contributor guide
Assessment
This issue has not been assessed yet.