Skip to main content
SweetPotato's user avatar
SweetPotato's user avatar
SweetPotato's user avatar
SweetPotato
  • Member for 4 years, 6 months
  • Last seen more than 3 years ago
Loading…
awarded
awarded
revised
Loading…
Loading…
comment
query an indexed jsonb column
Why doesn't the second query use the index? Is there a way I can index keys and values seperately so I can text search like I would with to_tsquery?
accepted
asked
Loading…
awarded
accepted
comment
Using Python to insert JSON into PostgreSQL
Found it in the psycopg2 documentation: "For positional variables binding, the second argument must always be a sequence, even if it contains a single variable (remember that Python requires a comma to create a single element tuple)" psycopg.org/docs/usage.html#query-parameters
comment
Using Python to insert JSON into PostgreSQL
I don't understand the necessity of the "," in the "cursor.execute(query_sql, (data,))" statement. Is that what you mean by wrapping it in a tuple?
comment
Using Python to insert JSON into PostgreSQL
Thank you for your answer, I eventually used json.dumps and figured it out.
asked
Loading…
awarded
accepted
asked
Loading…