0

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..?

Shmookoff
  • 146
  • 1
  • 10

1 Answers1

2

The issue was that I used f-strings. Don't use them, yeah... Documentation

Thanks @Marth ♥

Shmookoff
  • 146
  • 1
  • 10