diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2015-11-27 19:11:22 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2015-11-27 19:11:22 +0300 |
commit | 92e38182d7c8947a4ebbc1123b44f1245e232e85 (patch) | |
tree | f01ec11404a9b554cd9dc108409701e0fc86e001 /src/bin/psql/copy.c | |
parent | 0da3a9bef7ad36dc640aebf2d0482e18f21561f6 (diff) |
COPY (INSERT/UPDATE/DELETE .. RETURNING ..)
Attached is a patch for being able to do COPY (query) without a CTE.
Author: Marko Tiikkaja
Review: Michael Paquier
Diffstat (limited to 'src/bin/psql/copy.c')
-rw-r--r-- | src/bin/psql/copy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index f1eb518de79..c0fc28373a9 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -32,10 +32,12 @@ * * The documented syntax is: * \copy tablename [(columnlist)] from|to filename [options] - * \copy ( select stmt ) to filename [options] + * \copy ( query stmt ) to filename [options] * * where 'filename' can be one of the following: * '<file path>' | PROGRAM '<command>' | stdin | stdout | pstdout | pstdout + * and 'query' can be one of the following: + * SELECT | UPDATE | INSERT | DELETE * * An undocumented fact is that you can still write BINARY before the * tablename; this is a hangover from the pre-7.3 syntax. The options @@ -118,7 +120,7 @@ parse_slash_copy(const char *args) goto error; } - /* Handle COPY (SELECT) case */ + /* Handle COPY (query) case */ if (token[0] == '(') { int parens = 1; |