

In this tutorial, we will go through the basic steps on how to write a python script to read and write data on a Postgres database. We will start by describing what we have setup. I have a postgres instance running on a docker container which I will be using for this tutorial. You can watch this video that I made to learn how to spin up a postgres docker container obviously you don’t have to use docker you can still instal postgres phsyically on your machine or if you have a server running postgres that should do the trick. We will then start from scratch as usual using visual studio code and python3. We will talk about the #psycopg2 library and how to install it. we will start by establishing a connection to postgres, we will talk about cursors, client-side cursors, server-side cursors the differences. Then we will execute a cursor to retrieve all rows in the table and display them. we will then insert a row to the database and commit the changes
Our Source Code
More details on the official site here
🏭 Software Architecture Videos
💾 Database Engineering Videos
🛰 Network Engineering Videos
🏰 Load Balancing and Proxies Videos
🐘 Postgres Videos
🧮 Programming Pattern Videos
🛡 Web Security Videos
🦠 HTTP Videos
🐍 Python Videos
🔆 Javascript Videos
Enjoy guys!
Stay awesome
Hussein
source
Programming and laughing
hmmm, has anyone figured out the "InsufficientPriviledge" error that is produced at minute 12:20?
dude this is the first tutorial I'm watching from your channel and you made me follow with the way you talk and explain things :))))
cool tutorial, btw like ur sense of humor XD
I'm getting an error message when trying to install the psycopg2 with pip. I think it's requiring some pre-reqs that are not on my machine. Do you have a video or a url to point me towards for getting the pre-reqs setup first? Love the video. Thank you!
you are too funny and nice tutor
this is the most hilarious tutorial that I've ever seen, keep it up!! XD
fancy print haha rofl
Super Nice easy to understand
flawless….subscribed!
I'm getting error as ' ModuleNotFoundError: No module named 'psycopg2' ' how do i fix this?
You are the best!!!
FANTASTIC! FANTASTIC! FANTASTIC TUTORIAL!
Loved this!
Haha, your vids are fun to watch, thanks! Question: Why don't you use with clauses instead of opening and closing the connection?
Thanks for the entertaining video! However I get this error:
psycopg2.OperationalError: FATAL: role "postgres" does not exist
I followed your video about spinning up multiple postgres instances…
I have followed your steps but I don't know why I get this error. Do you know how I can test the connection too? Thank yooooou!
After working a long day, this video is just spice my life. Thanks!!!! it's SUPER FUNNY!
It was very helpful, thank you!
Hussein, quick question. Image that I have a db class with several methods (each one has a different goal), should I open and close the connection in each method or should I open the connection once my application starts running and later close it?
I have problem "OperationalError: could not connect to server: Connection timed out "
So what do i do?
But my program return "insternal server error"
"damn it that's javascript" XDDD what a cool teacher
Your teaching approach is really unique and fun.
Dude, not only you provided the info I needed, you also are hilarious. I´ll definitly watch your other videos.
how can i download psycopg2??
Hey Hussein, I don't specify my host but it still works, Not sure why??
nixce
When install psycopg2 and run the program it's showing an error apt-pkg in init.py file.
feels like i'm learning something illegal lmao
Nice tutorial!! Really well-explained, you got a new subscriber!
dudes a lifesaver
Enthusiasm levels are at Infinity & Great passion to teach .. What a man ..Take a bow
thank you Husseinfor your work, was funny, also could you please take video about gamification and some implementation example in django python like in lms project
ابو علي بروح جدك اريد انزل psycopg2 للوندوز ماجاي اكدر احمل البرنامج ممكن رابط البرنامج
Fantástico. Excelente y fácil
No offense. I'm grateful for the tutorial but there's only about 3 minutes worth of actual learning on here
You are a postsyko 3.7