So you've solved a common problem in PostgreSQL, a serious pain point that lots of other people could take advantage of. You want to open-source the code, and would like to package it up and distribute it where people can find it, read its docs, and download and install it.
The newest destination for distributing PostgreSQL extensions is <a>PGXN</a>, the PostgreSQL Extension network. PGXN offers a central index of PostgreSQL extensions and their documentation, making it easy for people to find an install extensions.
How do you optimize your extension distribution for maximum PGXN exposure? By careful packaging, thorough documentation, and simple installation. Join me for an overview of how best to achieve that — including how to build extensions compatible with PostgreSQL 9.1's improved extension support.
25. Your Solution
You’ve solved a problem
Using database objects
Packaged like contrib
Want to open-source it
How to distribute on PGXN?
26. Your Solution
You’ve solved a problem
Using database objects
Packaged like contrib
Want to open-source it
How to distribute on PGXN?
Just one thing:
27. Your Solution
You’ve solved a problem
Using database objects
Packaged like contrib
Want to open-source it
How to distribute on PGXN?
Just one thing:
META.json
80. pair 0.1.1
==========
Synopsis
‐‐‐‐‐‐‐‐
Must be UTF-8
or use a
% CREATE EXTENSION pair;
CREATE EXTENSION
BOM
% SELECT 'foo' ~> 'bar';
pair
‐‐‐‐‐‐‐‐‐‐‐‐
(foo,bar)
Description
‐‐‐‐‐‐‐‐‐‐‐
This library contains a single PostgreSQL extension, a
key/value pair data type called “pair”, along with a
convenience function for constructing key/value pairs.
It's just a simple thing, really: a two‐value composite
type that can store any type of value in its slots,
which are named `k` and `v`.
doc/pair.md
90. What Extensions
Might have multiple extensions
Extension might have own version
Might have documentation file
91. What Extensions
Might have multiple extensions
Extension might have own version
Might have documentation file
Help PGXN out!
92. What Extensions
Might have multiple extensions
Extension might have own version
Might have documentation file
Help PGXN out!
Add “provides” to META.json
96. Update Version
{
"name": "pair",
"abstract": "A key/value pair data type",
"version": "0.1. ",
0
"maintainer": "Tom Lane <tgl@postgresql.org>",
"license": "postgresql",
"description": "This library contains a key/value
pair data type called “pair”, along with an operator for
constructing key/value pairs.",
"meta‐spec": {
"version": "1.0.0",
"url": "http://pgxn.org/meta/spec.txt"
}
}
META.json
97. Update Version
{
"name": "pair",
"abstract": "A key/value pair data type",
"version": "0.1. ",
1
"maintainer": "Tom Lane <tgl@postgresql.org>",
"license": "postgresql",
"description": "This library contains a key/value
pair data type called “pair”, along with an operator for
constructing key/value pairs.",
"meta‐spec": {
"version": "1.0.0",
"url": "http://pgxn.org/meta/spec.txt"
}
}
META.json
98. Update Version
{
"name": "pair",
Must be
"abstract": "A key/value pair data type",
"version": "0.1. ",
1
unique.
"maintainer": "Tom Lane <tgl@postgresql.org>",
"license": "postgresql",
"description": "This library contains a key/value
pair data type called “pair”, along with an operator for
constructing key/value pairs.",
"meta‐spec": {
"version": "1.0.0",
"url": "http://pgxn.org/meta/spec.txt"
}
}
META.json
164. Migration from
Unpackaged
ALTER EXTENSION pair ADD TYPE pair;
ALTER EXTENSION pair ADD FUNCTION pair(anyelement, text);
ALTER EXTENSION pair ADD FUNCTION pair(text, anyelement);
ALTER EXTENSION pair ADD FUNCTION pair(anyelement, anyelement);
ALTER EXTENSION pair ADD FUNCTION pair(text, text);
ALTER EXTENSION pair ADD OPERATOR ~>(text, anyelement);
ALTER EXTENSION pair ADD OPERATOR ~>(anyelement, text);
ALTER EXTENSION pair ADD OPERATOR ~>(anyelement, anyelement);
ALTER EXTENSION pair ADD OPERATOR ~>(text, text);
sql/pair--unpackaged--0.1.0.sql
sql/pair‐‐unpac…