- Notifications
You must be signed in to change notification settings - Fork5
Commit94aceed
committed
Support multi-dimensional arrays in PL/python.
Multi-dimensional arrays can now be used as arguments to a PL/python function(used to throw an error), and they can be returned as nested Python lists.This makes a backwards-incompatible change to the handling of compositetypes in arrays. Previously, you could return an array of composite typesas "[[col1, col2], [col1, col2]]", but now that is interpreted as a two-dimensional array. Composite types in arrays must now be returned asPython tuples, not lists, to resolve the ambiguity. I.e. "[(col1, col2),(col1, col2)]".To avoid breaking backwards-compatibility, when not necessary, () is stillaccepted for arrays at the top-level, but it is always treated as asingle-dimensional array. Likewise, [] is still accepted for composite types,when they are not in an array. Update the documentation to recommend using []for arrays, and () for composite types, with a mention that those other thingsare also accepted in some contexts.This needs to be mentioned in the release notes.Alexey Grishchenko, Dave Cramer and me. Reviewed by Pavel Stehule.Discussion: <CAH38_tmbqwaUyKs9yagyRra=SMaT45FPBxk1pmTYcM0TyXGG7Q@mail.gmail.com>1 parent8c035e5 commit94aceed
File tree
7 files changed
+673
-63
lines changed- doc/src/sgml
- src/pl/plpython
- expected
- sql
7 files changed
+673
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
470 | 498 | | |
471 | 499 | | |
472 | 500 | | |
| |||
541 | 569 | | |
542 | 570 | | |
543 | 571 | | |
544 | | - | |
545 | | - | |
| 572 | + | |
| 573 | + | |
546 | 574 | | |
547 | 575 | | |
548 | 576 | | |
549 | 577 | | |
550 | 578 | | |
551 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
552 | 585 | | |
553 | 586 | | |
554 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
| 468 | + | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
0 commit comments
Comments
(0)