aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-04-04 15:25:16 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-04-04 15:25:16 -0400
commit2bbe9112aec60abc2d3b4c39e75d0cbdcaaa45e1 (patch)
treecd79ffca7612bdcd1ed77ff48b3f9e0a9be031b8 /src/backend/access/transam/xlogutils.c
parent66229ac0040cf1e0f5b9d72271aa9feaf3b3a37e (diff)
downloadpostgresql-2bbe9112aec60abc2d3b4c39e75d0cbdcaaa45e1.tar.gz
postgresql-2bbe9112aec60abc2d3b4c39e75d0cbdcaaa45e1.zip
Add a \gexec command to psql for evaluation of computed queries.
\gexec executes the just-entered query, like \g, but instead of printing the results it takes each field as a SQL command to send to the server. Computing a series of queries to be executed is a fairly common thing, but up to now you always had to resort to kluges like writing the queries to a file and then inputting the file. Now it can be done with no intermediate step. The implementation is fairly straightforward except for its interaction with FETCH_COUNT. ExecQueryUsingCursor isn't capable of being called recursively, and even if it were, its need to create a transaction block interferes unpleasantly with the desired behavior of \gexec after a failure of a generated query (i.e., that it can continue). Therefore, disable use of ExecQueryUsingCursor when doing the master \gexec query. We can still apply it to individual generated queries, however, and there might be some value in doing so. While testing this feature's interaction with single-step mode, I (tgl) was led to conclude that SendQuery needs to recognize SIGINT (cancel_pressed) as a negative response to the single-step prompt. Perhaps that's a back-patchable bug fix, but for now I just included it here. Corey Huinker, reviewed by Jim Nasby, Daniel Vérité, and myself
Diffstat (limited to 'src/backend/access/transam/xlogutils.c')
0 files changed, 0 insertions, 0 deletions