Created
January 7, 2021 08:36
-
-
Save diafour/d601a5f5adfc02549a47e12815f40964 to your computer and use it in GitHub Desktop.
python psycopg2 fetchall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur = self.conn.cursor() | |
cur.execute( | |
""" | |
SELECT | |
user_id | |
FROM | |
user_state | |
""" | |
) | |
user_ids = cur.fetchall() | |
for row in user_ids: | |
print(f"{row[0]}") | |
cur.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment