File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,12 @@ function execute(
119
119
)
120
120
level = throw_error ? error : warn
121
121
if parameters != = nothing
122
- string_params = string_parameters (parameters)
123
- pointer_params = parameter_pointers (string_params )
122
+ # https://postgrespro.com/list/thread-id/1893680
123
+ throw ( ArgumentError ( " COPY can't take any parameter " ) )
124
124
end
125
125
126
126
copy_end_result = lock (jl_conn) do
127
- if parameters === nothing
128
- result = _execute (jl_conn. conn, copy. query)
129
- else
130
- result = _execute (jl_conn. conn, copy. query, pointer_params)
131
- end
127
+ result = _execute (jl_conn. conn, copy. query)
132
128
result_status = libpq_c. PQresultStatus (result)
133
129
134
130
if result_status != libpq_c. PGRES_COPY_OUT
@@ -154,8 +150,8 @@ function execute(
154
150
seekstart (io) # rewind iobuffer so future user read will begin from start
155
151
if - 2 == status_code
156
152
level (LOGGER, Errors. JLResultError (
157
- " PQgetCopyData error: $(error_message (jl_conn)) "
158
- ))
153
+ " PQgetCopyData error: $(error_message (jl_conn)) "
154
+ ))
159
155
end
160
156
161
157
libpq_c. PQgetResult (jl_conn. conn)
Original file line number Diff line number Diff line change 505
505
@testset " Wrong COPY TO" begin
506
506
conn = LibPQ. Connection (" dbname=postgres user=$DATABASE_USER " )
507
507
508
- # test CopyOut!
508
+ # test CopyOut! with an error
509
509
databuf = IOBuffer ()
510
510
copyout = LibPQ. CopyOut! (databuf, " SELECT libpqjl_test;" )
511
511
517
517
@test occursin (" ERROR" , err_msg)
518
518
close (result)
519
519
520
+ # parameters are not supported
521
+ copyout = LibPQ. CopyOut! (databuf, " COPY (SELECT * FROM libpqjl_test WHERE no_nulls = \$ 1) TO STDOUT (FORMAT CSV, HEADER');" )
522
+ @test_throws ArgumentError execute (conn, copyout, [' z' ])
523
+
520
524
close (conn)
521
525
end
522
526
end
You can’t perform that action at this time.
0 commit comments