- Notifications
You must be signed in to change notification settings - Fork28
Commit75abb95
committed
Throw suitable error for COPY TO STDOUT/FROM STDIN in a SQL function.
A client copy can't work inside a function because the FE/BE wire protocoldoesn't support nesting of a COPY operation within query results. (Maybeit could, but the protocol spec doesn't suggest that clients should supportthis, and libpq for one certainly doesn't.)In most PLs, this prohibition is enforced by spi.c, but SQL functions don'tuse SPI. A comparison of _SPI_execute_plan() and init_execution_state()shows that rejecting client COPY is the only discrepancy in what theyallow, so there's no other similar bugs.This is an astonishingly ancient oversight, so back-patch to all supportedbranches.Report:https://postgr.es/m/BY2PR05MB2309EABA3DEFA0143F50F0D593780@BY2PR05MB2309.namprd05.prod.outlook.com1 parentf6d6d29 commit75abb95
1 file changed
+10
-1
lines changedLines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
500 | 500 |
| |
501 | 501 |
| |
502 | 502 |
| |
503 |
| - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
504 | 513 |
| |
505 | 514 |
| |
506 | 515 |
| |
|
0 commit comments
Comments
(0)