-
Notifications
You must be signed in to change notification settings - Fork 933
Open
Description
Query is
- defined as
query := pq.CopyIn("public.foo", "col_foo", "col_bar")
- prints as
COPY "public.foo" ("col_foo", "col_bar") FROM STDIN
.
Executing the prepared statement
- prepared via
tx.Prepare(query)
tx
being defined astx, err := db.Begin()
db
is of typesqlx.DB
, a connection established viasqlx.Connect
if that matters
via _, err := statement.Exec("foo", "bar")
returns either
sql: expected 0 arguments, got 2
- This occurs when I use "pgx" as the driver when establishing the connection.
pq: relation "public.foo" does not exist
when preparing- This occurs when I use "postgres" (pq) as the driver when establishing the connection. and is infinitely more puzzling, because not only does the relation exist when checked manually (
SELECT * FROM public.foo;
works fine in Postgres shell), but the application also contains aSELECT
statement that leftjoins onpublic.foo
, which works fine and returns no errors.
- This occurs when I use "postgres" (pq) as the driver when establishing the connection. and is infinitely more puzzling, because not only does the relation exist when checked manually (
I don't really see a reason for why this would happen, no relevant issues for either of the two points. I'd prefer to use pq
, because pgx
's CopyFrom
straight up does not support usage from transactions for whatever reason and requires a direct access to connection.
Let me know if I can provide anything else to elaborate.
Metadata
Metadata
Assignees
Labels
No labels