Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ea20397b
Commit
ea20397b
authored
Jun 28, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When using new protocol, PQexec can get out of a COPY IN or COPY OUT
state by itself, so do so.
parent
bf75f1a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
7 deletions
+42
-7
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+42
-7
No files found.
src/interfaces/libpq/fe-exec.c
View file @
ea20397b
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.14
0 2003/06/23 19:20:24
tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.14
1 2003/06/28 00:06:01
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1083,13 +1083,48 @@ PQexecStart(PGconn *conn)
*/
while
((
result
=
PQgetResult
(
conn
))
!=
NULL
)
{
if
(
result
->
resultStatus
==
PGRES_COPY_IN
||
result
->
resultStatus
==
PGRES_COPY_OUT
)
if
(
result
->
resultStatus
==
PGRES_COPY_IN
)
{
PQclear
(
result
);
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"COPY state must be terminated first
\n
"
));
return
false
;
if
(
PG_PROTOCOL_MAJOR
(
conn
->
pversion
)
>=
3
)
{
/* In protocol 3, we can get out of a COPY IN state */
if
(
PQputCopyEnd
(
conn
,
libpq_gettext
(
"COPY terminated by new PQexec"
))
<
0
)
{
PQclear
(
result
);
return
false
;
}
/* keep waiting to swallow the copy's failure message */
}
else
{
/* In older protocols we have to punt */
PQclear
(
result
);
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"COPY IN state must be terminated first
\n
"
));
return
false
;
}
}
else
if
(
result
->
resultStatus
==
PGRES_COPY_OUT
)
{
if
(
PG_PROTOCOL_MAJOR
(
conn
->
pversion
)
>=
3
)
{
/*
* In protocol 3, we can get out of a COPY OUT state: we
* just switch back to BUSY and allow the remaining COPY
* data to be dropped on the floor.
*/
conn
->
asyncStatus
=
PGASYNC_BUSY
;
/* keep waiting to swallow the copy's completion message */
}
else
{
/* In older protocols we have to punt */
PQclear
(
result
);
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"COPY OUT state must be terminated first
\n
"
));
return
false
;
}
}
PQclear
(
result
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment