PostgreSQL (2) Database Connection With Python Using 'Psycopg2' Module

preview_player
Показать описание
Hello and welcome to the second video of PostgreSQL tutorial series.
Today you are going to learn how to connect PostgreSQL database to Python program.

As a matter of fact, there are several python modules that allow us to connect to and manipulate the database using PostgreSQL such as Psycopg2 which will be the module that we will be working with in this tutorial.

Рекомендации по теме
Комментарии
Автор

Thank you very much for this tutorial. Your teaching skill is really awesome.

alamin
Автор

6 idiots 😝 dislike this great video !!
Thanks man

luizferez
Автор

what do i need to learn, if i am not getting why this code is put, and how it is done? prerquisite? i know basic python

deshnajain
Автор

Hey I am watching this video 3 years later and I like the concept but I am currently experiencing lots of errors when I run the main.py, connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgresql" this is the error I keep experiencing.
Thanks in advance.

nezzyyoung
Автор

I am new to postgresql, what is the point of connecting postgresql to python? thanks

yadali
Автор

I am at 10:22, at line 20 in config.py, have you putted "config()" only because you have mentionned the filename and the section when you defined the function above ?

right ?

ihebbibani
Автор

Wow, awesome tutorial video. I've watched hundreds of technical tutorials and I've never commented on one but this one was "the best." You nicely showed us how to connect a python script to Postgres using psycopg2. That's where everyone else would end their video. But then you threw it out and showed us that with a little more work, we could do it way better. Beautiful programming too. Even though you probably didn't make up the syntax, your explanation of why each part was necessary and shouldn't be different was superb. Liked and Subscribed

AshKatzEm
Автор

Thanx for a nice lesson and clear pronunciation which is easy-to-understand !

filipfilip
Автор

Спасибо что так подробно. Такие как я имеют шанс чему-то научиться, благодаря таким как вы.

АркадийНалимов-рэ
Автор

I tried doing what you suggested but I got an error after executing the config.py file. It says:

Traceback (most recent call last):
File "C:\Users\Janmielou\OneDrive\Documents\PostgresSQL\config.py", line 20, in <module>
config()
File "C:\Users\Janmielou\OneDrive\Documents\PostgresSQL\config.py", line 15, in config
raise Exception('Section{0} is not found in the {1} file.'.format(section, filename))
Exception: Sectionpostgresql is not found in the database.ini file.

skirkfallen
Автор

Thank you for making such a great video.

I encountered a problem with the main.py file. After running it I get the following error message:

Conecting to the postgreSQL database ...
invalid connection option "database"

HevelynMonteiro
Автор

incredibly helpful video. one question, to get the dictionary from the list of tuples around 9:10, why not simply do db = dict(parser.items(section)) ?

georgetait
Автор

I'm a newbie. You left me in the dust on the config file...lolol But everything you said was clear to me. I just need to practice

helovesdata
Автор

really helpful, but i hope you can share the code since i found some mistake in my code (and i just know what the wrong until i found indent)

ryanmalik
Автор

The ini approach is a pro move, thanks for the good job 👍

leonkennedy
Автор

thank u for the video and for your pronounciation, so easy to make out, thx

mr.vooper
Автор

Great video. Your explanations are great, thank you. Why does 'port' not need to be included in the database.ini file?

BigWatersBand
Автор

thanks for the good job. I encountered such a problem. When I try to write the password wrong, print(error) is empty in the console. Why? postgres 10.15 psycopg2 2.8.6

windsorjack
Автор

I am getting "Section postgresql is not found in the database.ini file" error even if I write everything right. I have checked thousand times. What could be the reason of this?

jijobuje
Автор

Fantastic video! I was wondering how you enable the description of classes or hints or arguments that go in on VS code. Is this an extension or does it come natively with intellisense? If so please suggest how to enable it? Liked and subscribed!

ajayjoseph
join shbcf.ru