Skip to content

Response to COPY command is interpreted as error #894

@sittim

Description

@sittim

I initially entered this issue here, but it seems that the error is actually from file pq/conn.go or pq/notify.go.

When using COPY keyword in file_go_execute_in_pq.sql file, the following error shows appears:

Migration failed: pq: unknown response for simple query: 'G' handling 20190903062409-test_data.sql

This is isolated COPY command:

COPY public.users (id, name, email, password, confirm_selector, confirm_verifier, confirmed, attempt_count, last_attempt, locked, recover_selector, recover_verifier, recover_token_expiry, o_auth2_u_i_d, o_auth2_provider, o_auth2_access_token, o_auth2_refresh_token, o_auth2_expiry, t_o_t_p_secret_key, s_m_s_phone_number, s_m_s_seed_phone_number, recovery_codes) FROM stdin;
1	username	[email protected]	$2a$1mysecrectpasswordEjCc8XddtcAPW			t	0	0001-01-01	0001-01-01			0001-01-01					0001-01-01				
\.

When copy command is executed like so psql -f file_with_above_statement.sql, reply is COPY 1.

So my theory is that the sql-migrate does not recognize the COPY 1 output which is the result of COPY statement and outputs an error;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-feedbackRequires feedback to be actionable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions