Executing an insert into postgres using psycopg2
<p>I'm trying to insert data using psycopg2 into postgres. Here is the psuedo code I have. It seems to run without error but when I use navicat to check, it doesn't seem to update in the database. I did restart navicat to be sure.</p>

<pre><code>conn = psycopg2.connect("dbname=dbname user=username password = ****  host='localhost'")
cur = conn.cursor()
</code></pre>

<p>Here I tried a straight execute and a mogrify.</p>

<pre><code>cur.mogrify("""INSERT INTO database (date, id) VALUES (now(), %s );""" % (user,))
cur.execute
</code></pre>

<p>I also tried this instead of the mogrify</p>

<pre><code>cur.execute("""INSERT INTO database (date, id) VALUES (now(), %s );""" % (user,))
</code></pre>

<p>I can query a select statement but insert doesn't seem to be working.</p>

<p>commit the data?</p>

<pre><code>conn.commit()
</code></pre>

python postgresql psycopg2