Skip to content

Commit 2adf740

Browse files
committed
Merge branch 'master' of github.com:mattmakai/fullstackpython.com
2 parents 408bd8f + b861649 commit 2adf740

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/posts/160518-install-postgresql-python-3-ubuntu-1604.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ and "password" values with your own.
164164
# run a SELECT statement - no data in there, but we can try it
165165
cursor.execute("""SELECT * from tutorials""")
166166
conn.commit() # <--- makes sure the change is shown in the database
167-
conn.close()
168-
cursor.close()
169167
rows = cursor.fetchall()
170168
print(rows)
169+
cursor.close()
170+
conn.close()
171171
except Exception as e:
172172
print("Uh oh, can't connect. Invalid dbname, user or password?")
173173
print(e)

0 commit comments

Comments
 (0)