DEV Community

Katie McLaughlin
Katie McLaughlin

Posted on • Edited on

2

Why is it called `psycopg2`?

To use PostgreSQL in Python you have to use psycopg2, or often psycopg2-binary.

What does psycopg2 mean, anyway? Furthermore, how do you pronounce it?

I didn't know before writing this article, so I looked it up, and documented my research.


As per initd.org:

Psycopg is the most popular PostgreSQL adapter for the Python programming language. At its core it fully implements the Python DB API 2.0 specifications.

Well, that explains the pg2 part -- postgres (db api) 2.

But what about "psyco"?


Reddit points out that Psyco is a now unmaintained project.

As per wikipedia's entry in Pysco:

Psyco was a specializing just-in-time compiler for Python.

Not to be confused with "Psycho", the 1960 movie (the one with the knife in the shower scene). Also not to be confused with 'psycho', the shortened term for 'psychopath', often used as a derogatory term.


But why is it called 'psyco'?


This I could not find the answer for.

Update July 2021: Someone reached out and shared with me this mailing list entry from 2018 with the answer! It was a typo!


So how do you pronounce it?

I am personally extremely reluctant to pronounce it "saɪˈkɑ-p-ɡ-to͞o", so at the moment I'm thinking of calling it "the postgres wrapper" or "postgres helper".


I took the time to write this up because the words we use to name things are important, but also words change over time. So when we have terms for packages that are named a term that then has connotations, it's important to reflect and think about our actions.

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (1)

Collapse
 
di profile image
Dustin Ingram

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay