Last week, a database connection setting brought me to a halt

Last Tuesday night, I was debugging a client dashboard from a shared office in Shenzhen. The Go program connected to PostgreSQL fine, but whenever it called the distance calculation, the database returned “function does not exist.” My first reaction was that I had written the code wrong. It turned out the database account used by the app had not enabled the relevant extension. I felt a little defeated: the business logic was already running, and the final step was blocked by permissions I could not see.

What PostgreSQL extensions actually are

Simply put, an extension adds an existing capability to the database. If a project needs to find nearby stores by distance, generate a special data format, or add search capabilities, an extension can reduce the amount of complex database logic we have to write ourselves. My friend Chenmin, who runs a store membership system in Hangzhou, once enabled a geospatial extension for a one-person tech-outsourcing project. By letting PostgreSQL handle “nearby stores” queries, she saved time maintaining her own coordinate-calculation code.

That said, not every indie project needs this approach. If your dataset is small and the requirements are not complex, PostgreSQL’s built-in features—or simply querying the tables—may be easier. There is no rush to try extensions.

What it costs to reproduce this today

The cost is about $0. PostgreSQL is already running, and most extensions can be installed directly from the official software repository. If you know what you are doing, it takes roughly 30 minutes; for a first attempt, I would allow 1–2 hours. The technical barrier is not high, but I need to find out whether the hosting platform permits extension installation and whether my account has the necessary permissions. First step: log in to the database management page, open the “Extensions” list, and check whether the target extension can be installed before touching the Go code.

The mistake I made before was spending a day rewriting business code, only to discover that the extension simply had not been enabled. My suggestion is to copy the data into a test database, get one minimal query working, and only then reconnect it to the production service. I have also been stuck when the permissions were unclear; in that case, the best move is to ask the platform’s support team for a list of “extensions that are allowed to be installed.”

How I would choose based on where you are now

If I had just started, with little data and only a few features, I would leave extensions alone and use PostgreSQL’s existing capabilities to ship, avoiding another dependency. If I already had 1–2 clients and was seeing repeated queries or calculation logic, I would install each extension in a test database one by one and document the installation and rollback steps in the project notes. If I was scaling up and several people were sharing the database, I would first sort out permissions, backups, and version compatibility, then have the developers configure it consistently so nobody changes the environment ad hoc.