Skip to content

Feature Request: PGXN-ready Artifact Generation in cargo pgrx package#2252

Open
Nirajkashyap wants to merge 3 commits intopgcentralfoundation:developfrom
Nirajkashyap:develop
Open

Feature Request: PGXN-ready Artifact Generation in cargo pgrx package#2252
Nirajkashyap wants to merge 3 commits intopgcentralfoundation:developfrom
Nirajkashyap:develop

Conversation

@Nirajkashyap
Copy link

PGXN Packaging Support for pgrx

Overview

This proposal adds support in pgrx to generate a PGXN-ready distributable artifact directly from the packaging command.

With a dedicated flag, cargo pgrx package will:

  • Generate a valid META.json (PGXN metadata) from Cargo.toml file OR use existing META.json file present in root folder in PGRX extension.
  • Bundle the extension into a .zip or .tar.gz archive
  • Produce an artifact ready for upload to PGXN

Motivation

Publishing a pgrx extension to PGXN currently requires several manual steps:

  1. Creating a meta.json
  2. Packaging files into the correct archive layout

Automating this workflow will:

  • Reduce friction for extension authors
  • Ensure consistent packaging
  • Simplify release automation (CI/CD)
  • Encourage more PGXN adoption

Proposed Usage

cargo pgrx package --pgxn --format zip

@Nirajkashyap Nirajkashyap marked this pull request as ready for review March 5, 2026 11:10
@eeeebbbbrrrr
Copy link
Contributor

A few notes here. First, I would not want cargo pgrx new to create a license file. That's for the user to do on their own -- it is not pgrx's place to even suggest a license to the user.

I also generally feel the same way about a readme file, but I'd be willing to let that happen so long as it's as minimal as possible. As in only lines 1-3 of what's in this PR.

Also, I'd prefer the PGXN-specific code be moved into its own pgxn.rs file.

If you're up for doing these things I'll take a more in-depth look once you've updated the PR. Thanks!

- Introduce pgxn module for PGXN package generation
- Remove unused license template and update README template
- Refactor package.rs to utilize new pgxn module for PGXN package creation
@Nirajkashyap
Copy link
Author

Nirajkashyap commented Mar 6, 2026

HI @eeeebbbbrrrr,
updated Pull request as per feedback and happy to update it. please review PR.

  • Introduce pgxn module for PGXN package generation
  • Remove unused license template and update README template
  • Refactor package.rs to utilize new pgxn module for PGXN package creation

happy to contribute in this project under your guidance.

Please help me to test this PR. please forward any link or doc where i can test this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants