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(
119119)
120120 level = throw_error ? error : warn
121121 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 " ) )
124124 end
125125
126126 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)
132128 result_status = libpq_c. PQresultStatus (result)
133129
134130 if result_status != libpq_c. PGRES_COPY_OUT
@@ -154,8 +150,8 @@ function execute(
154150 seekstart (io) # rewind iobuffer so future user read will begin from start
155151 if - 2 == status_code
156152 level (LOGGER, Errors. JLResultError (
157- " PQgetCopyData error: $(error_message (jl_conn)) "
158- ))
153+ " PQgetCopyData error: $(error_message (jl_conn)) "
154+ ))
159155 end
160156
161157 libpq_c. PQgetResult (jl_conn. conn)
Original file line number Diff line number Diff line change 505505 @testset " Wrong COPY TO" begin
506506 conn = LibPQ. Connection (" dbname=postgres user=$DATABASE_USER " )
507507
508- # test CopyOut!
508+ # test CopyOut! with an error
509509 databuf = IOBuffer ()
510510 copyout = LibPQ. CopyOut! (databuf, " SELECT libpqjl_test;" )
511511
517517 @test occursin (" ERROR" , err_msg)
518518 close (result)
519519
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+
520524 close (conn)
521525 end
522526 end
You can’t perform that action at this time.
0 commit comments