Using Python to query Postgres

preview_player
Показать описание
Blog:

Some quick and easy ways to extract data from Postgres and to import data from a file.

Follow me on Twitter:

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

Seriously the best video I've seen on this, sound quality is great, topic depth is perfect, and pace is spot on.

VanFlicke
Автор

Thank you for this!! This is exactly what I needed!! Something quick and simple for someone who's not too lazy to learn SQL, rather than the 50 million overblown/bloated "packages" all python devs seem to depend on to interact w/databases. I got more out of this 6 minute video than 1/2 a day of digging through the vaguely written "documentation" for useless things like SqlAlchemy, and Pony ORM... You rock!!

squish
Автор

So simple and to the point! Thank you for your video! I love how concise it is.

SerottaPDX
Автор

Very helpful. A lot of practical information in a short video. Thanks!

johnflood
Автор

I don't understand how you can get r["firstname"], because r is not a dict but a tuple (and the varible rows is a list whose elements are those tuples).

RagHelen
Автор

It is 2017 now, we have real ORM to deal with databases in a more pythonic way. SqlAlchemy, Peewee, Pony ORM and Django ORM are the ways to go. Pony ORM offers you the ability to query your connected database with generator expression, which is really cool and truly pythonic ;)

Just saying psycopg2 is also used in these ORMs, at least in sqlalchemy as a low level connection layer, but as user you don't need to deal with it.

Pterryreal
Автор

cur.execute('SELECT * FROM table')
cur.fetchone()

I am sure i have no typos but above commands return nothing in python

looploop
Автор

Great tutorial but the db = user = 'postgres' password = 'localhost'") gives an error psycopg2.OperationalError: fe_sendauth: no password supplied

bobbymidha
Автор

this is very helpful. but how about installing psycopg2 in windows tutorial? need help here. thanks

ivytorremonia
visit shbcf.ru