Skip to content

Instantly share code, notes, and snippets.

@Matt3o12
Created August 16, 2014 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Matt3o12/2135ce92b2b1978d9781 to your computer and use it in GitHub Desktop.
Save Matt3o12/2135ce92b2b1978d9781 to your computer and use it in GitHub Desktop.
import timeit;
import psycopg2
def psy():
with psycopg2.connect(user="Matt3o12", password="", host="localhost", port=5432, database="Matt3o12") as conn:
pass
if __name__ == "__main__":
i = 0
try:
for i in range(500):
psy()
except:
print("Failed after {} connections...".format(i))
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment