forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit86d3398
committed
SQL/JSON: Rethinkc2d93c3
This essentially revertsc2d93c3 except tests. The problem withc2d93c3 was that it only changed the casting behavior for typeswith typmod, and had coding issues noted in the post-commit review.This commit changes coerceJsonFuncExpr() to use assignment-level castsinstead of explicit casts to coerce the result of JSON constructorfunctions to the specified or the default RETURNING type. Usingassignment-level casts fixes the problem that using explicit casts wasleading to the wrong typmod / length coercion behavior -- truncatingresults longer than the specified length instead of erroring out --whichc2d93c3 aimed to solve.That restricts the set of allowed target types to string types, thesame set that's currently allowed.Discussion:https://postgr.es/m/202406291824.reofujy7xdj3@alvherre.pgsql1 parentec67869 commit86d3398
1 file changed
+10
-24
lines changedLines changed: 10 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3582 | 3582 |
| |
3583 | 3583 |
| |
3584 | 3584 |
| |
3585 |
| - | |
3586 | 3585 |
| |
3587 | 3586 |
| |
3588 | 3587 |
| |
| |||
3612 | 3611 |
| |
3613 | 3612 |
| |
3614 | 3613 |
| |
3615 |
| - | |
3616 |
| - | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
3617 | 3621 |
| |
3618 |
| - | |
3619 |
| - | |
3620 |
| - | |
3621 |
| - | |
3622 | 3622 |
| |
3623 |
| - | |
3624 |
| - | |
3625 |
| - | |
3626 |
| - | |
3627 |
| - | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
3628 | 3626 |
| |
3629 | 3627 |
| |
3630 | 3628 |
| |
| |||
3649 | 3647 |
| |
3650 | 3648 |
| |
3651 | 3649 |
| |
3652 |
| - | |
3653 | 3650 |
| |
3654 | 3651 |
| |
3655 | 3652 |
| |
| |||
3687 | 3684 |
| |
3688 | 3685 |
| |
3689 | 3686 |
| |
3690 |
| - | |
3691 |
| - | |
3692 |
| - | |
3693 |
| - | |
3694 |
| - | |
3695 |
| - | |
3696 |
| - | |
3697 |
| - | |
3698 |
| - | |
3699 |
| - | |
3700 |
| - | |
3701 | 3687 |
| |
3702 | 3688 |
| |
3703 | 3689 |
| |
|
0 commit comments
Comments
(0)