Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response to COPY command is interpreted as error #894

Open
sittim opened this issue Sep 7, 2019 · 2 comments
Open

Response to COPY command is interpreted as error #894

sittim opened this issue Sep 7, 2019 · 2 comments

Comments

@sittim
Copy link

sittim commented Sep 7, 2019

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@gmail.com $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;

@ddevault
Copy link

ddevault commented Mar 5, 2021

I am able to reproduce this, with response 'C' instead.

@Fiyin-Anne
Copy link

Hi @ddevault pls were you able to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants