Reputation: 48
I've tried
SQL
CREATE TABLE table_name (key BYTEA, key_uuid UUID)
Python
cur.execute(f"INSERT INTO table_name (key, key_uuid) VALUES({Fernet.generate_key()}, uuid_generate_v4())")
It gives an error:
psycopg2.errors.InvalidTextRepresentation: "j" is not a valid binary digit
LINE 1: ...me (key, key_uuid) VALUES(b'jBB72dwn...
^
Or am I understanding this wrong..?
Upvotes: 0
Views: 232
Reputation: 48
The issue was that I used f-strings. Don't use them, yeah... Documentation
Thanks @Marth ♥
Upvotes: 2