error installing psycopg2, library not found for -lssl

For anyone looking for a solution for this on macOS Sierra 10.12 (or later, most likely): I fixed this by installing the command line tools: xcode-select –install After that, pip install psycopg2 should work. If it doesn’t, you could also try to link against brew’s openssl: env LDFLAGS=”-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib” pip install psycopg2 with openssl installed … Read more

psycopg2: insert multiple rows with one query

I built a program that inserts multiple lines to a server that was located in another city. I found out that using this method was about 10 times faster than executemany. In my case tup is a tuple containing about 2000 rows. It took about 10 seconds when using this method: args_str=”,”.join(cur.mogrify(“(%s,%s,%s,%s,%s,%s,%s,%s,%s)”, x) for x … Read more

DatabaseError: current transaction is aborted, commands ignored until end of transaction block?

This is what postgres does when a query produces an error and you try to run another query without first rolling back the transaction. (You might think of it as a safety feature, to keep you from corrupting your data.) To fix this, you’ll want to figure out where in the code that bad query … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)