Replies: 1 comment
-
If the value doesn't take single quotes, it is likely a PostgreSQL If the value must be surrounded by single quotes, it is a string literal: see PostgreSQL docs. You can use the sql.SQL("ALTER ROLE {} WITH PASSWORD {}").format(sql.Identifier("abc"), sql.Literal("def")).as_string(conn)
# ALTER ROLE "abc" WITH PASSWORD 'def' |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
What's a proper way to quote and construct sql queries like this:
"Identifiers usually represent names of database objects, such as tables or fields."
Does that apply to usernames, encoding etc, too? Like
Other problematic queries:
Beta Was this translation helpful? Give feedback.
All reactions