TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: pgxman – npm for Postgres extensions

81 pointsby coatueover 1 year ago
pgxman is npm for Postgres extensions, simplifying the discovery and use of extensions so you can easily enhance your applications.<p>Installing and updating Postgres extensions is an uphill battle. You&#x27;re left searching for the right build tools and grappling with often unclear and incomplete compiling instructions to even try one out. But with pgxman, we&#x27;ve streamlined the process to one simple step: pgxman install [extension name].<p>For example, to build parquet_s3_fdw manually, you&#x27;d need to:<p>1. Download the parquet_s3_fdw source code;<p>2. Figure out how to build it by looking at README. When unclear, look at the source code how to build it. The README of parquet_s3_fdw says it needs libarrow, libparquet &amp; aws_sdk. Readme doesn’t say where to get them.<p>3. Make sure all dependencies are available to build the project. Either install them from apt, if available, or build them manually if not. For parquet_s3_fdw aws_sdk has to be built manually — it’s not available in any apt repos<p>4. Build the extension targeting the correct OS, CPU architecture and Postgres version.<p>5. Determine and build to the right path &#x2F;usr&#x2F;lib&#x2F;postgresql&#x2F;15&#x2F;lib - otherwise, Postgres wouldn’t be able to find them.<p>6. Repeat across all relevant Postgres instances. Hopefully, these Postgres versions are recent or else you’ll have to update postgres, set maintenance window, etc.<p>* Added friction: Since parquet_s3_fdw is not designed to use in a cloud environment, and we forked it to make changes to make it possible to use.<p>Using pgxman, you can just do:<p><pre><code> pgxman install s3_parquet_fdw </code></pre> pgxman integrates with your system package manager, ensuring the correct versions are installed without extra packages from any shared dependencies between extensions. pgxman’s automated build system creates [APT] packages for each Postgres version, platform, and OS supported by the extension. Extensions are built from a “buildkit” formula, written in YAML, and are contributed through GitHub.<p>To install pgxman, you can do<p><pre><code> brew install pgxman&#x2F;tap&#x2F;pgxman </code></pre> or, if you don&#x27;t mind pipe-to-shell,<p><pre><code> curl -sfl https:&#x2F;&#x2F;install.pgx.sh | sh - </code></pre> If you&#x27;d like to learn more, we have an extensive blog post here: <a href="https:&#x2F;&#x2F;www.hydra.so&#x2F;blog-posts&#x2F;the-design-of-postgres-extension-manager-pgxman">https:&#x2F;&#x2F;www.hydra.so&#x2F;blog-posts&#x2F;the-design-of-postgres-exten...</a>.

7 comments

lfittlover 1 year ago
Other related projects:<p>* PGXN (<a href="https:&#x2F;&#x2F;pgxn.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;pgxn.org&#x2F;</a> - the original Postgres community extension repository, though more &quot;old school&quot;)<p>* Trunk by Tembo (<a href="https:&#x2F;&#x2F;github.com&#x2F;tembo-io&#x2F;trunk">https:&#x2F;&#x2F;github.com&#x2F;tembo-io&#x2F;trunk</a> - very similar to pgxman, but using the more liberal Postgres BSD-style license)<p>Additionally its important to mention that many popular extensions are already packaged as part of the Postgres YUM and Apt repositories (<a href="https:&#x2F;&#x2F;wiki.postgresql.org&#x2F;wiki&#x2F;Apt" rel="nofollow noreferrer">https:&#x2F;&#x2F;wiki.postgresql.org&#x2F;wiki&#x2F;Apt</a> and <a href="https:&#x2F;&#x2F;yum.postgresql.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;yum.postgresql.org&#x2F;</a>).<p>I would generally recommend using the upstream repository packages directly, since they are tested&#x2F;updated with each major release, and their maintainers are proactive in reaching out to extension maintainers that need to update their extension due to upstream code changes.
评论 #38491345 未加载
评论 #38468397 未加载
评论 #38496168 未加载
metadatover 1 year ago
I didn&#x27;t even know I wanted this, but after seeing it, makes 100% sense!<p>What an incredibly good idea.<p>Edit: Looks like there is some existing (partial) competition from pgxn: <a href="https:&#x2F;&#x2F;manager.pgxn.org&#x2F;about" rel="nofollow noreferrer">https:&#x2F;&#x2F;manager.pgxn.org&#x2F;about</a>
评论 #38491426 未加载
SahAssarover 1 year ago
A core part of npm is that the dependencies are installed in the folder&#x2F;project you are working in (unless you use the --global flag which is discouraged for most use-cases).<p>Can I use this in any way without a global system state? Like with <a href="https:&#x2F;&#x2F;github.com&#x2F;zonkyio&#x2F;embedded-postgres-binaries">https:&#x2F;&#x2F;github.com&#x2F;zonkyio&#x2F;embedded-postgres-binaries</a> or similar that don&#x27;t have a global install? Or with a distro that supports multiple versions&#x2F;instances of postgresql?
评论 #38467164 未加载
hitoriover 1 year ago
I&#x27;m not sure what is `npm` your meaning, is it <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.npmjs.com&#x2F;</a> ?<p>Is pgxman an extension manager for Postgres like apt for Debian?
评论 #38469972 未加载
matthews2over 1 year ago
&gt; pgxman’s automated build system creates [APT] packages<p>Could these packages be put in a repository online, so that they can be installed without using pgxman?
e12eover 1 year ago
Interesting - does it work with the existing postgres apt&#x2F;yum repos?<p>Does it work with the postgres Docker image? Can I:<p><pre><code> FROM postgres (...get pxman) pgxman install ...</code></pre>
评论 #38470652 未加载
grilledchickenwover 1 year ago
ooof, that render on the homepage consistently brings my Chrome browser to its knees.
评论 #38467946 未加载
评论 #38469558 未加载