aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-01-14 13:27:47 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-01-14 13:27:47 -0500
commit75abb955dfef064f2fbc5c043f37fff8d0262ffe (patch)
treef57d802ae98e998c12cd8780e0cf72f3710bb42f /src/backend/parser/parse_clause.c
parentf6d6d2920d2cddc4b381cbbf2915db9d985d20a9 (diff)
downloadpostgresql-75abb955dfef064f2fbc5c043f37fff8d0262ffe.tar.gz
postgresql-75abb955dfef064f2fbc5c043f37fff8d0262ffe.zip
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 protocol doesn't support nesting of a COPY operation within query results. (Maybe it could, but the protocol spec doesn't suggest that clients should support this, and libpq for one certainly doesn't.) In most PLs, this prohibition is enforced by spi.c, but SQL functions don't use SPI. A comparison of _SPI_execute_plan() and init_execution_state() shows that rejecting client COPY is the only discrepancy in what they allow, so there's no other similar bugs. This is an astonishingly ancient oversight, so back-patch to all supported branches. Report: https://postgr.es/m/BY2PR05MB2309EABA3DEFA0143F50F0D593780@BY2PR05MB2309.namprd05.prod.outlook.com
Diffstat (limited to 'src/backend/parser/parse_clause.c')
0 files changed, 0 insertions, 0 deletions