Ray P.
Ray P.

Reputation: 925

Postgresql sessions from psql and psycopg2

I am running two terminal sessions, in the first one I've opened psql, and in the second one ipython with psycopg2 imported. I'm connected to the same db in both sessions. When I update a table through ipython/psycopg2, psql session queries won't reflect the updates (i.e. I add a row in a table via psycopg2, and psql still fetches no rows). What am I doing wrong?

Upvotes: 1

Views: 1539

Answers (1)

Gwidryj
Gwidryj

Reputation: 1035

Probably, after executing update you didn't execute commit() (it makes the changes to the database persistent) on the connection object. See the first example in the docs http://initd.org/psycopg/docs/usage.html

Upvotes: 1

Related Questions