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

#321: postgres and pgx support schema name in \copy #460

Closed
wants to merge 1 commit into from

Conversation

murfffi
Copy link
Contributor

@murfffi murfffi commented Apr 28, 2024

Closes #321

Adds support postgres and pgx support schema name in table destination in \copy.
TestCopy in drivers_test is extended with cases with schema names.
go test -v -tags pgx . -dbs=pgsql,pgx -test.run=TestCopy after the fix. The new test cases
failed without the fix.

Even the existing test case for pgx failed for me with this output:

$ go test -v -tags pgx . -dbs=pgsql,pgx -test.run=TestCopy
=== RUN   TestCopy
2024/04/28 20:10:49 Could not copy: ERROR: COPY from stdin failed: unable to encode (*interface {})(0xc0002b4120) into binary format for int4 (OID 23): cannot find encode plan (SQLSTATE 57014)
FAIL    github.com/xo/usql/drivers      0.048s
FAIL

I added code to dereference the pointers populated by Scan before passing them to pgx.Copy
to resolve that issue.

@murfffi murfffi closed this Apr 29, 2024
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

Successfully merging this pull request may close these issues.

\copy command: An error occurs when the target table with a schema
1 participant