-
Notifications
You must be signed in to change notification settings - Fork 936
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) txbeing defined astx, err := db.Begin()dbis of typesqlx.DB, a connection established viasqlx.Connectif 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 existwhen 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 aSELECTstatement 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