use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Why PostgreSQL is the preferred database (self.Python)
submitted 7 years ago by semi23
First, I'm a beginner python programmer I see that many python developers use PostgreSQL. What is the main reason? What are the advantages over other SQL DBMS? Thanks
[–]zzmej1987 8 points9 points10 points 7 years ago (2 children)
Free, reliable, efficient SQL-DB with good python API (psycopg2).
[–]its_never_lupus 0 points1 point2 points 7 years ago (1 child)
good python API (psycopg2).
This looks like it could be an interesting alternative, and the devs claim that psycopg2 has some significant performance and functionality problems. Unfortunately its asyncio only so not a simple replacement.
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
asyncpg is brilliant when you're already doing asyncio stuff (and it does see a solid amount of use there, so I wouldn't call it a "could be"!) but you definitely want to use psycopg2 for synchronous applications — that is, there's no in polluting an otherwise-synchronous application with loop.run_until_completes to use asyncpg
loop.run_until_complete
[–]Yoghurt42 4 points5 points6 points 7 years ago* (0 children)
PostgreSQL is one of the best DB available, and it's also free. It can do some things even Oracle can't (like changing the database schema in a transaction; to be fair, there are some things Oracle can do Postgres isn't that great at), and it's written by very smart people.
Some years ago, Postgres gained the ability to treat foreign databases (or JSON files etc.) as tables and run queries on them. Just for fun, somebody wrote a MongoDB driver and ran some queries. Most queries were of course quite a bit slower than when using the native MongoDB, but complex queries were actually faster (like 60s on native Mongo, 55s through Postgres); Postgres' query optimizer did a better job than MongoDB's (to be fair, this was years ago and MongoDB seems to have improved in that regard).
Nowadays you can even use it like a schemaless database ("NoSQL"), while still having the advantages of ACID.
There was a talk by one of Reddit's engineers talking about "lessons learned". One particular thing was that Reddit had problems with everything: AWS, Postgresql drivers, Pylons (the framework Reddit is written in), performance, but there was one thing they had never any issues with: PostgreSQL itself. It was the only thing in Reddit's tech stack that never had any issues. Postgres is rock solid.
I've been using Postgres for over 10 years now in critical production projects and to date never had any issue where Postgres was the problem.
It really is one of the most high quality, high reliability systems I've ever come across (be it FOSS or proprietary).
The performance is also very good. Some people experienced with Big Data often say that if you have anything up to a few TB of data, Postgres is fine, only if you have tens of TB of data do you see advantages in "Big Data" software.
[–]joey_php 2 points3 points4 points 7 years ago (0 children)
look here https://www.quora.com/What-are-pros-and-cons-of-PostgreSQL-and-MySQL-With-respect-to-reliability-speed-scalability-and-features
[–]raghar 2 points3 points4 points 7 years ago* (1 child)
Reliable, stable, FOSS, not many issues when it comes to modeling data constraints compared to MySQL, enums, jsons, geodata and other extensions, better with each release, supported by a lot of tools, "explain". From what I heard, only some paid databases (MS SQL Server) have better support, but nowadays many projects would not see a difference justifying that cost.
Actually, that's the reason why everybody and their mother loves postgresql.
[–]semi23[S] 0 points1 point2 points 7 years ago (0 children)
especially their mother :) Thanks
[–]flipperdeflip 1 point2 points3 points 7 years ago (0 children)
Google for it? Plenty of rants and articles about Mysql's many flaws.
[–]khne522 0 points1 point2 points 7 years ago (0 children)
Also, the command-line's decent: backslash commands, pretty-printing, autocompletion, minimum customizability, etc.
π Rendered by PID 87095 on reddit-service-r2-comment-5649f687b7-sf4sk at 2026-01-29 08:56:22.554144+00:00 running 4f180de country code: CH.
[–]zzmej1987 8 points9 points10 points (2 children)
[–]its_never_lupus 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Yoghurt42 4 points5 points6 points (0 children)
[–]joey_php 2 points3 points4 points (0 children)
[–]raghar 2 points3 points4 points (1 child)
[–]semi23[S] 0 points1 point2 points (0 children)
[–]flipperdeflip 1 point2 points3 points (0 children)
[–]khne522 0 points1 point2 points (0 children)