postgresql blocked on mac 1

postgresql blocked on mac

$ brew services stop postgresql
$ rm /usr/local/var/postgres/postmaster.pid # adjust path accordingly to your install
$ brew services start postgresql

Here is what the above code is Doing:
1. We’re using the psycopg2 library to connect to our database.
2. We’re using the .cursor() method to create a cursor object.
3. We’re using the cursor object to execute a query.
4. We’re using the .fetchall() method to fetch all the results of the query.
5. We’re using the .close() method to close the cursor object.
6. We’re using the .close() method to close the connection to the database.

Similar Posts