Hi guys, we would like to write and read binary data to/from QuestDB. We are using Python direct writer and/or WebUI. I was unable to write binary data with Python or WebUI. Is there a way to do it in WebUI? Thanks
09/13/2022, 8:48 AM
Hi Michal,You should be able to write and read binary values via PG Wire (so, a Postgres driver, like psycopg).
09/13/2022, 9:19 AM
Hi Andrey, do you have an example of the usage of this driver? Tbh I don't get how a driver can help me if it is not more of a protocol than a driver.
with psycopg.connect("dbname=qdb user=admin password=quest host=localhost port=8812") as conn:
with conn.cursor() as cur:
cur.execute("CREATE TABLE IF NOT EXISTS binary_table (name STRING, binary_data BINARY);")
cur.execute("INSERT INTO binary_table VALUES (%s,%s)", ('Hello', b'b string'))
for record in cur.execute("SELECT * FROM binary_table"):
Duplicated the snippet on the GH issue
09/13/2022, 11:31 AM
will try, thanks
yeap in psycopg 3 it is working. but WebUI does not show anything and neither does downloading data via WebUI. But we can live with that. Thanks, Andrei 🙂