You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Split array_push into separate array_append and array_prepend functions.
There wasn't any good reason for a single C function to implement boththese SQL functions: it saved very little code overall, and it requiredsignificant pushups to re-determine at runtime which case applied. Redoingit as two functions ends up with just slightly more lines of code, but it'ssimpler to understand, and faster too because we need not repeat syscachelookups on every call.An important side benefit is that this eliminates the only case in whichdifferent aliases of the same C function had both anyarray and anyelementarguments at the same position, which would almost always be a mistake.The opr_sanity regression test will now notice such mistakes since there'sno longer a valid case where it happens.
Copy file name to clipboardExpand all lines: src/include/catalog/pg_proc.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -878,9 +878,9 @@ DATA(insert OID = 2176 ( array_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 2
878
878
DESCR("array length");
879
879
DATA(insert OID = 3179 ( cardinality PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2277" _null_ _null_ _null_ _null_ array_cardinality _null_ _null_ _null_ ));
880
880
DESCR("array cardinality");
881
-
DATA(insert OID = 378 ( array_append PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2277 2283" _null_ _null_ _null_ _null_array_push _null_ _null_ _null_ ));
881
+
DATA(insert OID = 378 ( array_append PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2277 2283" _null_ _null_ _null_ _null_array_append _null_ _null_ _null_ ));
882
882
DESCR("append element onto end of array");
883
-
DATA(insert OID = 379 ( array_prepend PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2283 2277" _null_ _null_ _null_ _null_array_push _null_ _null_ _null_ ));
883
+
DATA(insert OID = 379 ( array_prepend PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2283 2277" _null_ _null_ _null_ _null_array_prepend _null_ _null_ _null_ ));
884
884
DESCR("prepend element onto front of array");
885
885
DATA(insert OID = 383 ( array_cat PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2277 2277" _null_ _null_ _null_ _null_ array_cat _null_ _null_ _null_ ));
886
886
DATA(insert OID = 394 ( string_to_array PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 1009 "25 25" _null_ _null_ _null_ _null_ text_to_array _null_ _null_ _null_ ));