UseAppendEventForUpdateLock
flag
Hey, I ran into a difference in behavior using Patch<T>(id).Set("prop", value) when running pgsql 11 with plv8 2.3.11 locally in docker vs a paas instance in azure. The document had a nested array like
{
"prop": "v",
"prop2": {
"arr": [1, 2, 3]
}
}
Locally the document is updated as expected but in the cloud instance the array is emptied of all but one element.
Ideas?
Alright, I'll see if I can narrow it down a bit.
Just to sanity check
Simply running select mt_transform_patch_doc('{ "Number": 123, "Arr": [ { "Id": 1 }, { "Id": 2 } ]}', '{"type":"set","value":100000,"path":"Number"}')
Yields {"Arr": [{"Id": 2}], "Number": 100000}
in azure and {"Arr": [{"Id": 1}, {"Id": 2}], "Number": 100000}
locally
patch won't match
<= nice title for a Hip Hop song)
A final update,
```CREATE FUNCTION plv8_test(inp jsonb) RETURNS jsonb AS returninp.Arr.length; LANGUAGE plv8 IMMUTABLE STRICT;
select plv8_test(CAST('{ "Number": 123, "Arr": [ { "Id": 1 }, { "Id": 2 } ]}' as jsonb));```
Returns 1 on the azure instance and 2 on my local instance...
AssertDatabaseMatchesConfiguration
after adding a property or more critically removing one then I'd get an exception thrown. This was my only way of protecting the database from a destructive change.