forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb135508
committed
Following up a previous thought I had, yesterday I realised how to
return arays nicely without having to make the plperl programmer awareof anything. The attached patch allows plperl to return an arrayrefwhere the function returns an array type. It silently calls a perlfunction to stringify the array before passing it to the pg arrayparser. Non-array returns are handled as before (i.e. passed throughthis process) so it is backwards compatible. I will presently submitregression tests and docs.example:andrew=# create or replace function blah() returns text[][] languageplperl as $$ return [['a"b','c,d'],['e\\f','g']]; $$;CREATE FUNCTIONandrew=# select blah(); blah----------------------------- {{"a\"b","c,d"},{"e\\f",g}}This would complete half of the TODO item: . Pass arrays natively instead of as text between plperl and postgres(The other half is translating pg array arguments to perl arrays - thatwill have to wait for 8.1).Some of this patch is adapted from a previously submitted patch fromSergej Sergeev. Both he and Abhijit Menon-Sen have looked it overbriefly and tentatively said it looks ok.Andrew Dunstan1 parent6d92f21 commitb135508
1 file changed
+75
-6
lines changedLines changed: 75 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| |||
81 | 81 |
| |
82 | 82 |
| |
83 | 83 |
| |
| 84 | + | |
84 | 85 |
| |
85 | 86 |
| |
86 | 87 |
| |
| |||
194 | 195 |
| |
195 | 196 |
| |
196 | 197 |
| |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
197 | 218 |
| |
198 | 219 |
| |
| 220 | + | |
199 | 221 |
| |
200 | 222 |
| |
201 | 223 |
| |
| |||
231 | 253 |
| |
232 | 254 |
| |
233 | 255 |
| |
| 256 | + | |
234 | 257 |
| |
235 | 258 |
| |
236 | 259 |
| |
| |||
331 | 354 |
| |
332 | 355 |
| |
333 | 356 |
| |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
334 | 385 |
| |
335 | 386 |
| |
336 | 387 |
| |
| |||
869 | 920 |
| |
870 | 921 |
| |
871 | 922 |
| |
872 |
| - | |
| 923 | + | |
| 924 | + | |
873 | 925 |
| |
874 | 926 |
| |
875 | 927 |
| |
| |||
890 | 942 |
| |
891 | 943 |
| |
892 | 944 |
| |
893 |
| - | |
| 945 | + | |
| 946 | + | |
894 | 947 |
| |
895 | 948 |
| |
896 | 949 |
| |
| |||
904 | 957 |
| |
905 | 958 |
| |
906 | 959 |
| |
907 |
| - | |
| 960 | + | |
| 961 | + | |
908 | 962 |
| |
909 | 963 |
| |
910 | 964 |
| |
| |||
949 | 1003 |
| |
950 | 1004 |
| |
951 | 1005 |
| |
952 |
| - | |
953 |
| - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
954 | 1020 |
| |
955 | 1021 |
| |
956 | 1022 |
| |
| |||
1208 | 1274 |
| |
1209 | 1275 |
| |
1210 | 1276 |
| |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1211 | 1280 |
| |
1212 | 1281 |
| |
1213 | 1282 |
| |
|
0 commit comments
Comments
(0)