Changes between Initial Version and Version 1 of Ticket #26355, comment 3
- Timestamp:
- Mar 16, 2016, 9:58:52 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26355, comment 3
initial v1 56 56 Python: Item.objects.update(value__1_1=[4, 5, 6]) # would need different syntax? 57 57 SQL: UPDATE item SET value = value[array_lower(value, 1):1] 58 || ARRAY[4, 5, 6] || value[ 3:array_upper(value, 1)];59 Result: [1, 4, 5, 6, 3]58 || ARRAY[4, 5, 6] || value[2:array_upper(value, 1)]; 59 Result: [1, 4, 5, 6, 2, 3] 60 60 }}} 61 62 Note that updating a slice with more or less values that the width of the slice will require the same approach as the above example because PostgreSQL silently drops excess values provided and `ERROR: source array too small` is thrown if there are not enough values. 61 63 62 64 Another consideration is for the `array_prepend` function, but I'm not sure how that could be handled nicely in the expressions syntax.