Repository navigation
Allow references to columns in UPDATE statements - #472
Conversation
| @@ -0,0 +1,30 @@ | |||
| CREATE TABLE modifications ( | |||
There was a problem hiding this comment.
Is there a reason to add a test file? Why not using multi_modifications.sql ?
There was a problem hiding this comment.
Because waiting for that comment was easier than searching for the right place myself :) Moved the tests there and rebased.
873baf0 to
2503e07
Compare
There was a problem hiding this comment.
On line 335 there is a check for IsA(setTargetEntry->expr, Var). Do you or Önder Kalacı (@onderkalaci) know why there is an explicit check for that. Is there a case that it not covered by contain_mutable_functions that we can support, or is this something specific to upsert?
There was a problem hiding this comment.
It's covered by contain_mutable_functions. Onder says they added it to be explicit that naked Var's are allowed.
There was a problem hiding this comment.
I can add a test for that as well if you'd like
5fe50bf to
693a797
Compare
| gm | 247 | ||
| (1 row) | ||
|
|
||
| -- updates referencing an unpure function are unsupported |
There was a problem hiding this comment.
Not sure what unpure means. PostgreSQL distinguishes between immutable, stable, and volatile. Only the first one is allowed. I think you mean pure -> immutable, unpure -> volatile.
There was a problem hiding this comment.
I've been doing too much functional programming, updated the comments
|
Since there's an open TODO for it: Do we need to update the error message? |
|
How about |
|
Right now we say: But it looks like every codepath which emits that message now checks for mutable functions in the expression |
|
"Mutable" is not really used in PostgreSQL documentation, so I'm not sure if users can easily understand what it means. Maybe something similar to PostgreSQL's error message: e.g. |
|
A nice future enhancement would be to skip all these checks when the replication factor is 1. |
|
Pending squashing: 🚢 |
|
If we start allowing more than one |
|
I assumed we already locked, because that's equally true of concurrent a = 28 Nis 2016 Per 21:55 tarihinde Jason Petersen [email protected]
|
Fix #240
To do: