-
Notifications
You must be signed in to change notification settings - Fork 883
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
Create User in postgres with pgx (SQLSTATE 42601) #1173
Comments
Prepared or parameterized statements are only possible with |
@jackc though, now, how do I prevent against SQL injection attacks if I am using string interpolation? |
You'll have to sanitize the strong yourself first. There is a fairly long-running request for non-driver dependant quoting in Go Issue #18478 with a few potential solutions that might be helpful. |
@paudley there seems to be a Santinize function in pgx, would that not be good enough? |
https://pkg.go.dev/github.com/jackc/pgx/v4#Identifier will do what you want. |
Hi! Another question related to this, why does it not work with positional arguments for the password?
Throws error: |
@maxlengdell See earlier reply: #1173 (comment) |
I am trying to create a user in postgres. I have the below
But I get this
ERROR: syntax error at or near "$1" (SQLSTATE 42601)
I don't get what's the problem here ?
The text was updated successfully, but these errors were encountered: