You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I look at connection.readonly too many times.
The code is:
importpsycopg2aspgfrompsycopg2importextrasconn=pg.connect("...")
conn.set_session(autocommit=False, readonly=False)
withconn.cursor(name="test") ascu:
cu.execute("select * from twits order by sid limit 11000;")
forsid,recincu:
ifconn.readonly:
raiseValueError("immutable")
withconn.cursor() ascu1:
cu1.execute("INSERT INTO twits (sid, status) VALUES (%s, %s) ON CONFLICT"" (sid) DO UPDATE SET status = excluded.status;",
(sid, extras.Json(rec)))
ifcu.rownumber==cu.itersize:
print(sid)
The table is created by
CREATETABLEtwits (
sid bigintNOT NULLPRIMARY KEY,
status jsonb NOT NULL
);
when I remove
ifconn.readonly:
raiseValueError("immutable")
the problem disappears.
When I remove conn.set_session(autocommit=False, readonly=False), the crash turns into Fatal Python error: deallocating None.
PS. I check readonly because the connection is shared between threads.
The text was updated successfully, but these errors were encountered:
I get
when I look at
connection.readonly
too many times.The code is:
The table is created by
when I remove
the problem disappears.
When I remove
conn.set_session(autocommit=False, readonly=False)
, the crash turns intoFatal Python error: deallocating None
.PS. I check
readonly
because the connection is shared between threads.The text was updated successfully, but these errors were encountered: