I am using pq and I have a function like this:
func UpdateTable(tx *sql.Tx) error {
_, err := tx.Exec(`
copy public.mytable FROM
's3://mybucket/mytable' credentials
'aws_access_key_id=$1;aws_secret_access_key=$2' DELIMITER AS '|'
GZIP ESCAPE;`,
os.Getenv("AWS_ACCESS_KEY_ID"),
os.Getenv("AWS_SECRET_ACCESS_KEY"))
if err != nil {
return err
}
return nil
}
When attempting to run the function, I receive the error
pq: got 2 parameters but the statement requires 0
Is this due to the raw string and single quotes in the SQL statement? Can I make this work with the string literal?