We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This does not work for me
with connection.cursor() as cursor: query = "DO $$ BEGIN BEGIN INSERT INTO testtable2 (test1, test2, test3) VALUES (%s, %s, %s); END; END $$;" parameters = (333, 'STRING $$$ SOME STRING', 'Some string', ) cursor.execute(query, parameters) cursor.execute("COMMIT") connection.close()
But when I remove the $ sign in the string, it is working ?
STRING $$$ SOME STRING
or If I escape the $ it is working as well.
Like this works /root/test_bug2.py:20: SyntaxWarning: invalid escape sequence '$' parameters = (333, 'STRING $$$ SOME STRING', 'Some string', )
with connection.cursor() as cursor: query = "DO $$ BEGIN BEGIN INSERT INTO testtable2 (test1, test2, test3) VALUES (%s, %s, %s); END; END $$;" parameters = (333, 'STRING \$\$\$ SOME STRING', 'Some string', ) cursor.execute(query, parameters) cursor.execute("COMMIT") connection.close()
The text was updated successfully, but these errors were encountered:
Does it work with psycopg 3?
Sorry, something went wrong.
PostgreSQL version: I'm using Yugabytes
I think it's a bug on their side.
No branches or pull requests
This does not work for me
with connection.cursor() as cursor:
query = "DO $$ BEGIN BEGIN INSERT INTO testtable2 (test1, test2, test3) VALUES (%s, %s, %s); END; END $$;"
parameters = (333, 'STRING $$$ SOME STRING', 'Some string', )
cursor.execute(query, parameters)
cursor.execute("COMMIT")
connection.close()
But when I remove the $ sign in the string, it is working ?
STRING $$$ SOME STRING
or If I escape the $ it is working as well.
Like this works
/root/test_bug2.py:20: SyntaxWarning: invalid escape sequence '$'
parameters = (333, 'STRING $$$ SOME STRING', 'Some string', )
with connection.cursor() as cursor:
query = "DO $$ BEGIN BEGIN INSERT INTO testtable2 (test1, test2, test3) VALUES (%s, %s, %s); END; END $$;"
parameters = (333, 'STRING \$\$\$ SOME STRING', 'Some string', )
cursor.execute(query, parameters)
cursor.execute("COMMIT")
connection.close()
The text was updated successfully, but these errors were encountered: