Clean up BeginCommand and related routines. BeginCommand and EndCommand
Tom Lane <tgl@sss.pgh.pa.us>
Clean up BeginCommand and related routines. BeginCommand and EndCommand are now both invoked once per received SQL command (raw parsetree) from pg_exec_query_string. BeginCommand is actually just an empty routine at the moment --- all its former operations have been pushed into tuple receiver setup routines in printtup.c. This makes for a clean distinction between BeginCommand/EndCommand (once per command) and the tuple receiver setup/teardown routines (once per ExecutorRun call), whereas the old code was quite ad hoc. Along the way, clean up the calling conventions for ExecutorRun a little bit.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/common/printtup.c | modified | +70 −12 |
| src/backend/access/common/tupdesc.c | modified | +2 −2 |
| src/backend/commands/command.c | modified | +35 −45 |
| src/backend/executor/execMain.c | modified | +33 −69 |
| src/backend/executor/functions.c | modified | +7 −7 |
| src/backend/executor/spi.c | modified | +34 −26 |
| src/backend/tcop/dest.c | modified | +13 −101 |
| src/backend/tcop/postgres.c | modified | +15 −14 |
| src/backend/tcop/pquery.c | modified | +20 −41 |
| src/backend/utils/mmgr/portalmem.c | modified | +3 −3 |
| src/include/access/printtup.h | modified | +4 −3 |
| src/include/executor/execdefs.h | modified | +1 −18 |
| src/include/executor/execdesc.h | modified | +7 −2 |
| src/include/executor/executor.h | modified | +2 −2 |
| src/include/tcop/dest.h | modified | +20 −16 |