{"slug": "psycopg", "name": "psycopg", "category": "databases", "category_name": "Databases", "description": "", "recommenders": 3, "commenters": 5, "warners": 0, "score": 3.357, "rising": 1.67, "first": "2026-03-04", "latest": "2026-10-25", "why": "I do love the Pydantic functionality that comes out of the box w pyscopg3.", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 3, "neutral": 2, "compare": 0, "warn": 0}, "spark": [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1], "listed": true, "loved": [], "caveat": "", "short_quote": "I do love the Pydantic functionality that comes out of the box w pyscopg3.", "kind": "", "icon": true, "domain": "psycopg.org", "github_repo": null, "official_url": "https://www.psycopg.org", "pricing": "", "aliases": ["psycopg", "psycopg3"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 803720801, "item_id": 50232550, "url": "https://news.ycombinator.com/item?id=50232550", "by": "alex_suzuki", "date": "2026-10-25", "stance": "recommend", "quote": "it\u2019s surprisingly ergonomic in my (limited) experience", "excerpt": "> SQLAlchemy has an eDSL of SQL, so you can skip the whole ORM/table mapping layer, and just use it to programmatically construct SQL syntax Yes, this is called SQLAlchemy Core: http://docs.sqlalchemy.org/en/latest/core/ You can also just use psycopg (the Postgres driver layer) directly, it\u2019s surprisingly ergonomic in my (limited) experience.", "context": "", "use_case": "", "switched_from": "", "story": "Show HN: Farol \u2013 A risk map of a pull request for the person who approves it"}, {"id": 788099824, "item_id": 49256239, "url": "https://news.ycombinator.com/item?id=49256239", "by": "JackSlateur", "date": "2026-08-11", "stance": "recommend", "quote": "t-string main use case is SQL (for instance, in psycopg", "excerpt": "t-string main use case is SQL (for instance, in psycopg\u00b9) You can write things like that without SQL injection: t\"INSERT INTO mytable (first_name, last_name) VALUES ({first_name}, {last_name})\" This is a very pleasant feature, very useful [1] https://www.psycopg.org/psycopg3/docs/basic/tstrings.html", "context": "", "use_case": "PostgreSQL driver", "switched_from": "", "story": "Python string literals are kinda funny"}, {"id": 758512128, "item_id": 47407008, "url": "https://news.ycombinator.com/item?id=47407008", "by": "luckycharms810", "date": "2026-03-16", "stance": "recommend", "quote": "I do love the Pydantic functionality that comes out of the box w pyscopg3.", "excerpt": "As a non ORM person - I do love the Pydantic functionality that comes out of the box w pyscopg3. https://www.psycopg.org/psycopg3/docs/advanced/typing.html#example-returning-records-as-pydantic-models", "context": "non-ORM user", "use_case": "PostgreSQL driver", "switched_from": "", "story": "Show HN: Oxyde \u2013 Pydantic-native async ORM with a Rust core"}]}], "caveats": [], "who": [{"by": "luckycharms810", "context": "non-ORM user", "url": "https://news.ycombinator.com/item?id=47407008", "date": "2026-03-16"}], "tags": [], "use_cases": ["postgresql driver"], "compared": [{"slug": "sqlalchemy", "name": "SQLAlchemy", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=50231349", "title": "Show HN: Farol \u2013 A risk map of a pull request for the person who approves it", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49441033", "title": "Python's pre-declared constants are kinda weird", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49192556", "title": "Python string literals are kinda funny", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47364260", "title": "Show HN: Oxyde \u2013 Pydantic-native async ORM with a Rust core", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47243804", "title": "Better JIT for Postgres", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {}, "2026-02": {}, "2026-03": {"neutral": 1, "recommend": 1}, "2026-04": {}, "2026-05": {}, "2026-06": {}, "2026-07": {}, "2026-08": {"recommend": 1, "neutral": 1}, "2026-09": {}, "2026-10": {"recommend": 1}}, "quotes": [{"id": 803720801, "item_id": 50232550, "url": "https://news.ycombinator.com/item?id=50232550", "by": "alex_suzuki", "date": "2026-10-25", "stance": "recommend", "quote": "it\u2019s surprisingly ergonomic in my (limited) experience", "excerpt": "> SQLAlchemy has an eDSL of SQL, so you can skip the whole ORM/table mapping layer, and just use it to programmatically construct SQL syntax Yes, this is called SQLAlchemy Core: http://docs.sqlalchemy.org/en/latest/core/ You can also just use psycopg (the Postgres driver layer) directly, it\u2019s surprisingly ergonomic in my (limited) experience.", "context": "", "use_case": "", "switched_from": "", "story": "Show HN: Farol \u2013 A risk map of a pull request for the person who approves it"}, {"id": 791202113, "item_id": 49450132, "url": "https://news.ycombinator.com/item?id=49450132", "by": "frollogaston", "date": "2026-08-26", "stance": "neutral", "quote": "Even psycopg2 needed a whole rework to psycopg3 for this, and it still has caveats", "excerpt": "List default args are well-documented because everyone runs into it and no other language does it that way. \"You can use it to cache values between function calls:\" and I really hope nobody does that. Python has \"relative imports\" in that you can import relative packages, not files. So the weirdness is, even within my little app, I have to define packages for everything rather than just doing like require(\"./common.j", "context": "", "use_case": "", "switched_from": "", "story": "Python's pre-declared constants are kinda weird"}, {"id": 788099824, "item_id": 49256239, "url": "https://news.ycombinator.com/item?id=49256239", "by": "JackSlateur", "date": "2026-08-11", "stance": "recommend", "quote": "t-string main use case is SQL (for instance, in psycopg", "excerpt": "t-string main use case is SQL (for instance, in psycopg\u00b9) You can write things like that without SQL injection: t\"INSERT INTO mytable (first_name, last_name) VALUES ({first_name}, {last_name})\" This is a very pleasant feature, very useful [1] https://www.psycopg.org/psycopg3/docs/basic/tstrings.html", "context": "", "use_case": "PostgreSQL driver", "switched_from": "", "story": "Python string literals are kinda funny"}, {"id": 758512128, "item_id": 47407008, "url": "https://news.ycombinator.com/item?id=47407008", "by": "luckycharms810", "date": "2026-03-16", "stance": "recommend", "quote": "I do love the Pydantic functionality that comes out of the box w pyscopg3.", "excerpt": "As a non ORM person - I do love the Pydantic functionality that comes out of the box w pyscopg3. https://www.psycopg.org/psycopg3/docs/advanced/typing.html#example-returning-records-as-pydantic-models", "context": "non-ORM user", "use_case": "PostgreSQL driver", "switched_from": "", "story": "Show HN: Oxyde \u2013 Pydantic-native async ORM with a Rust core"}, {"id": 756014305, "item_id": 47250894, "url": "https://news.ycombinator.com/item?id=47250894", "by": "kbolino", "date": "2026-03-04", "stance": "neutral", "quote": "will automatically manage prepared statements for you", "excerpt": "It is not always necessary to explicitly use prepared statements, though. For example, the pgx library for Go [1] and the psycopg3 library for Python [2] will automatically manage prepared statements for you. [1]: https://pkg.go.dev/github.com/jackc/pgx/v5#hdr-Prepared_Statements [2]: https://www.psycopg.org/psycopg3/docs/advanced/prepare.html", "context": "", "use_case": "", "switched_from": "", "story": "Better JIT for Postgres"}]}