Successfully reported this slideshow.

Releasing PostgreSQL Extension on PGXN

800 views

Published on

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.

Published in: Technology
  • Be the first to comment

Releasing PostgreSQL Extension on PGXN

  1. 1. Releasing Extensions on PGXN David E. Wheeler PostgreSQL Experts, Inc. PDXPUG April 21, 2019Text: Attribution-Noncommercial-Share Alike 3.0 United States:http://creativecommons.org/licenses/by-nc-sa/3.0/us/Images licensed independently and © Their respective owners.
  2. 2. Problem Solved
  3. 3. Problem SolvedSolved a database problem
  4. 4. Problem SolvedSolved a database problemWant to share
  5. 5. Problem SolvedSolved a database problemWant to shareOpen source it
  6. 6. Problem SolvedSolved a database problemWant to shareOpen source itWhere to distribute
  7. 7. PGXN
  8. 8. PGXN“The PostgreSQL Extension network, is a central distribution system for open-source PostgreSQL extension libraries.”
  9. 9. wheeler
  10. 10. wheeler
  11. 11. Your Solution
  12. 12. Your SolutionYou’ve solved a problem
  13. 13. Your SolutionYou’ve solved a problemUsing database objects
  14. 14. Your SolutionYou’ve solved a problemUsing database objectsPackaged like contrib
  15. 15. Your SolutionYou’ve solved a problemUsing database objectsPackaged like contribWant to open-source it
  16. 16. Your SolutionYou’ve solved a problemUsing database objectsPackaged like contribWant to open-source itHow to distribute on PGXN?
  17. 17. Your SolutionYou’ve solved a problemUsing database objectsPackaged like contribWant to open-source itHow to distribute on PGXN?Just one thing:
  18. 18. Your SolutionYou’ve solved a problemUsing database objectsPackaged like contribWant to open-source itHow to distribute on PGXN?Just one thing:META.json
  19. 19. META.jsonMETA.json
  20. 20. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  21. 21. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  22. 22. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  23. 23. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  24. 24. META.json{ semver.org


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  25. 25. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  26. 26. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} META.json
  27. 27. META.json{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}} At least this… META.json
  28. 28. Package it Up!%

  29. 29. Package it Up!%


git
archive
‐‐format
zip
‐‐prefix=pair‐0.1.0/


‐‐output
~/Desktop/pair‐0.1.0.zip
master%
  30. 30. Package it Up!%


git
archive
‐‐format
zip
‐‐prefix=pair‐0.1.0/


‐‐output
~/Desktop/pair‐0.1.0.zip
master% Easy, eh?
  31. 31. Tom Lanetgl@postgresql.orghttp://postgresql.org/~tgl/tomlane@tomlaneI’ve got some killer extensions in development that I thinkwill be useful to everyone, including:* pair: an ordered pair data type* PL/Brainfuck: just what it sounds like
  32. 32. Tom Lanetgl@postgresql.orghttp://postgresql.org/~tgl/tomlane@tomlaneI’ve got some killer extensions in development that I thinkwill be useful to everyone, including:* pair: an ordered pair data type* PL/Brainfuck: just what it sounds like
  33. 33. tomlane
  34. 34. omg WTF ROTFL lolzomg WTF ROTFL lolz
  35. 35. omg WTF ROTFL lolzomg WTF ROTFL lolz
  36. 36. tomlane●●●●●●●●●●●●●●●●●●
  37. 37. tomlane
  38. 38. No resources,tags, or long description
  39. 39. No documentation link
  40. 40. Plain textREADME
  41. 41. Add README Extension%

  42. 42. Add README Extension%


git
mv
README.pair
README.md%
  43. 43. Add README Extension%


git
mv
README.pair
README.md% Easy, eh?
  44. 44. PGXN Markup
  45. 45. PGXN MarkupHTML TextileMarkdown TracMultiMarkdown MediaWikiPod
  46. 46. PGXN MarkupHTML TextileMarkdown TracMultiMarkdown MediaWikiPodText::Markup (fork me!)
  47. 47. PGXN MarkupHTML TextileMarkdown TracMultiMarkdown MediaWikiPodText::Markup (fork me!)Write some Docs!
  48. 48. Add Documentation
  49. 49. Add DocumentationUse any supported markup
  50. 50. Add DocumentationUse any supported markupPut wherever you like
  51. 51. Add DocumentationUse any supported markupPut wherever you likeRecommend the doc/
  52. 52. doc/pair.md
  53. 53. pair
0.1.1==========Synopsis‐‐‐‐‐‐‐‐



%
CREATE
EXTENSION
pair;



CREATE
EXTENSION



%
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.
Its
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
  54. 54. 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.
Its
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
  55. 55. Add Description{


"name":






"pair",


"abstract":


"A
key/value
pair
data
type",


"version":



"0.1.0",


"maintainer":
"Tom
Lane
<tgl@postgresql.org>",


"license":



"postgresql",


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}}META.json
  56. 56. Add Description{


"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
  57. 57. Add Tags


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"


}}META.json
  58. 58. Add Tags


"meta‐spec":

{





"version":
"1.0.0",





"url":
"http://pgxn.org/meta/spec.txt"



,


}


"tags":
[





"ordered
pair",





"pair",





"key
value"


]}META.json
  59. 59. Add Resources


"tags":
[





"ordered
pair",





"pair",





"key
value"


]}META.json
  60. 60. Add Resources


"tags":
[





"ordered
pair",





"pair",





"key
value"



,


]


"resources":
{





"bugtracker":
{








"web":
"https://github.com/tgl/kv‐pair/issues/"





},





"repository":
{








"type":
"git",








"url":
"git://github.com/tgl/kv‐pair.git",








"web":
"https://github.com/tgl/kv‐pair/"





}


}}META.json
  61. 61. What Extensions
  62. 62. What ExtensionsMight have multiple extensions
  63. 63. What ExtensionsMight have multiple extensionsExtension might have own version
  64. 64. What ExtensionsMight have multiple extensionsExtension might have own versionMight have documentation file
  65. 65. What ExtensionsMight have multiple extensionsExtension might have own versionMight have documentation fileHelp PGXN out!
  66. 66. What ExtensionsMight have multiple extensionsExtension might have own versionMight have documentation fileHelp PGXN out!Add “provides” to META.json
  67. 67. Add Provides





"repository":
{








"type":
"git",








"url":
"git://github.com/tgl/kv‐pair.git",








"web":
"https://github.com/tgl/kv‐pair/"





}


}}META.json
  68. 68. Add Provides





"repository":
{








"type":
"git",








"url":
"git://github.com/tgl/kv‐pair.git",








"web":
"https://github.com/tgl/kv‐pair/"





}



,


}


"provides":
{





"pair":
{








"file":
"sql/pair.sql",








"version":
"0.1.0",








"abstract":
"A
key/value
pair
data
type",








"docfile":
"doc/pair.md"





}


}}META.json
  69. 69. Add Provides





"repository":
{








"type":
"git",








"url":
"git://github.com/tgl/kv‐pair.git",








"web":
"https://github.com/tgl/kv‐pair/"





}



,


}


"provides":
{





"pair":
{








"file":
"sql/pair.sql", It’s unchanged!








"version":
"0.1.0",








"abstract":
"A
key/value
pair
data
type",








"docfile":
"doc/pair.md"





}


}}META.json
  70. 70. 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
  71. 71. 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
  72. 72. 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
  73. 73. Package it up%

  74. 74. Package it up%


git
archive
‐‐format
zip
‐‐prefix=pair‐0.1.1/


‐‐output
~/Desktop/pair‐0.1.1.zip
master%
  75. 75. Release it
  76. 76. Lots of great metadata!
  77. 77. Link todocumentation!
  78. 78. README in HTML!
  79. 79. README in HTML!
  80. 80. Niiiice.
  81. 81. What Else?
  82. 82. What Else?Recommended file layout
  83. 83. What Else?Recommended file layoutStandard Makefile format
  84. 84. What Else?Recommended file layoutStandard Makefile format9.1 CREATE EXTENSION support
  85. 85. What Else?Recommended file layoutStandard Makefile format9.1 CREATE EXTENSION support With compatibility!
  86. 86. File Recommendations
  87. 87. File RecommendationsSQL source in sql/
  88. 88. File RecommendationsSQL source in sql/C source in src/
  89. 89. File RecommendationsSQL source in sql/C source in src/Tests in test/
  90. 90. File RecommendationsSQL source in sql/C source in src/Tests in test/Documentation in docs/
  91. 91. Rearrange%

  92. 92. Rearrange%
%
mkdir
test
  93. 93. Rearrange%
%
mkdir
test%
git
mv
sql
test/
  94. 94. Rearrange%
%
mkdir
test%
git
mv
sql
test/%
git
mv
expected
test/
  95. 95. Rearrange%
%
mkdir
test%
git
mv
sql
test/%
git
mv
expected
test/%
mkdir
sql
  96. 96. Rearrange%
%
mkdir
test%
git
mv
sql
test/%
git
mv
expected
test/%
mkdir
sql%
git
mv
*.sql
sql/
  97. 97. MakefileMakefile
  98. 98. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c)) Makefile
  99. 99. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c)) Makefile
  100. 100. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c)) Makefile
  101. 101. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c)) Makefile
  102. 102. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=test Makefile
  103. 103. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=test Makefile
  104. 104. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=test Makefile
  105. 105. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=test Makefile
  106. 106. Makefile inputdirDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=test Makefile
  107. 107. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testPG_CONFIG
=
pg_configPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  108. 108. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testPG_CONFIG
=
pg_configPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  109. 109. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testPG_CONFIG
=
pg_configPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  110. 110. MakefileDATA



=
$(wildcard
sql/*.sql)DOCS



=
$(wildcard
doc/*.txt)MODULES
=
$(patsubst
%.c,%,$(wildcard
src/*.c))TESTS
=
$(wildcard
test/sql/*.sql)REGRESS
=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testPG_CONFIG
=
pg_configPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  111. 111. CREATE EXTENSION
  112. 112. CREATE EXTENSIONNew in 9.1
  113. 113. CREATE EXTENSIONNew in 9.1Add extension to a DB with
  114. 114. CREATE EXTENSIONNew in 9.1Add extension to a DB with CREATE EXTENSION pair;
  115. 115. CREATE EXTENSIONNew in 9.1Add extension to a DB with CREATE EXTENSION pair;No need to run SQL script in psql
  116. 116. Packaging Extensions Needs
  117. 117. Packaging Extensions NeedsControl file
  118. 118. Packaging Extensions NeedsControl fileMigration from unpackaged
  119. 119. Packaging Extensions NeedsControl fileMigration from unpackaged pair--unpackaged--0.1.0.sql
  120. 120. Packaging Extensions NeedsControl fileMigration from unpackaged pair--unpackaged--0.1.0.sqlProperly-named SQL script
  121. 121. Packaging Extensions NeedsControl fileMigration from unpackaged pair--unpackaged--0.1.0.sqlProperly-named SQL script pair--0.1.0.sql
  122. 122. Create the control filepair.control
  123. 123. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  124. 124. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  125. 125. Create the control file Optional#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  126. 126. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  127. 127. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  128. 128. Create the control file#
pair
extension For Ccomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0 codemodule_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  129. 129. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  130. 130. Create the control file#
pair
extension Can movecomment
=
A
key/value
pair
data
type schemasdefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  131. 131. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control
  132. 132. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
true Not requiredsuperuser
=
false to install pair.control
  133. 133. Create the control file#
pair
extensioncomment
=
A
key/value
pair
data
typedefault_version
=
0.1.0module_pathname
=
$libdir/pairrelocatable
=
truesuperuser
=
false pair.control pair.control
  134. 134. Migration from Unpackagedsql/pair‐‐unpac…
  135. 135. Migration from UnpackagedALTER
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…
  136. 136. Update the MakefileMakefile
  137. 137. Update the MakefileEXTENSION



=
semverEXTVERSION


=
$(shell
grep
default_version


$(EXTENSION).control
|

sed
‐e


"s/default_version[
]*=[
]*([^]*)/1/")DATA








=
$(filter‐out
$(wildcard
sql/*‐‐*.sql),$(wildcard
sql/*.sql))DOCS








=
$(wildcard
doc/*.txt)TESTS







=
$(wildcard
test/sql/*.sql)REGRESS





=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testMODULES





=
$(patsubst
%.c,%,$(wildcard
src/*.c))PG_CONFIG



=
pg_configPG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  138. 138. Update the MakefileEXTENSION



=
semverEXTVERSION


=
$(shell
grep
default_version


$(EXTENSION).control
|

sed
‐e


"s/default_version[
]*=[
]*([^]*)/1/")DATA








=
$(filter‐out
$(wildcard
sql/*‐‐*.sql),$(wildcard
sql/*.sql))DOCS








=
$(wildcard
doc/*.txt)TESTS







=
$(wildcard
test/sql/*.sql)REGRESS





=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testMODULES





=
$(patsubst
%.c,%,$(wildcard
src/*.c))PG_CONFIG



=
pg_configPG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  139. 139. Update the MakefileEXTENSION



=
semverEXTVERSION


=
$(shell
grep
default_version


$(EXTENSION).control
|

sed
‐e


"s/default_version[
]*=[
]*([^]*)/1/")DATA








=
$(filter‐out
$(wildcard
sql/*‐‐*.sql),$(wildcard
sql/*.sql))DOCS








=
$(wildcard
doc/*.txt)TESTS







=
$(wildcard
test/sql/*.sql)REGRESS





=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testMODULES





=
$(patsubst
%.c,%,$(wildcard
src/*.c))PG_CONFIG



=
pg_configPG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  140. 140. Update the Makefile Extract fromEXTENSION



=
semverEXTVERSION


=
$(shell
grep
default_version
 control file

$(EXTENSION).control
|

sed
‐e


"s/default_version[
]*=[
]*([^]*)/1/")DATA








=
$(filter‐out
$(wildcard
sql/*‐‐*.sql),$(wildcard
sql/*.sql))DOCS








=
$(wildcard
doc/*.txt)TESTS







=
$(wildcard
test/sql/*.sql)REGRESS





=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testMODULES





=
$(patsubst
%.c,%,$(wildcard
src/*.c))PG_CONFIG



=
pg_configPG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  141. 141. Update the MakefileEXTENSION



=
semverEXTVERSION


=
$(shell
grep
default_version


$(EXTENSION).control
|

sed
‐e


"s/default_version[
]*=[
]*([^]*)/1/")DATA








=
$(filter‐out
$(wildcard
sql/*‐‐*.sql),$(wildcard
sql/*.sql))DOCS








=
$(wildcard
doc/*.txt)TESTS







=
$(wildcard
test/sql/*.sql)REGRESS





=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testMODULES





=
$(patsubst
%.c,%,$(wildcard
src/*.c))PG_CONFIG



=
pg_configPG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  142. 142. Update the MakefileEXTENSION



=
semverEXTVERSION


=
$(shell
grep
default_version


$(EXTENSION).control
|

sed
‐e


"s/default_version[
]*=[
]*([^]*)/1/")DATA








=
$(filter‐out
$(wildcard
sql/*‐‐*.sql),$(wildcard
sql/*.sql))DOCS








=
$(wildcard
doc/*.txt)TESTS







=
$(wildcard
test/sql/*.sql)REGRESS





=
$(patsubst
test/sql/%.sql,%,$(TESTS))REGRESS_OPTS
=
‐‐inputdir=testMODULES





=
$(patsubst
%.c,%,$(wildcard
src/*.c))PG_CONFIG



=
pg_configPG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  143. 143. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes) Makefile
  144. 144. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  145. 145. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  146. 146. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  147. 147. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  148. 148. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  149. 149. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  150. 150. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  151. 151. Update the MakefilePG91

=
$(shell
$(PG_CONFIG)
‐‐version


|
grep
‐qE
"
8.|
9.0"
&&
echo
no
||
echo
yes)ifeq
($(PG91),yes)all:
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlsql/$(EXTENSION)‐‐$(EXTVERSION).sql:
sql/$(EXTENSION).sql
 cp
$<
$@DATA
=
$(wildcard
sql/*‐‐*.sql)
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlEXTRA_CLEAN
=
sql/$(EXTENSION)‐‐$(EXTVERSION).sqlendifPGXS
:=
$(shell
$(PG_CONFIG)
‐‐pgxs)include
$(PGXS) Makefile
  152. 152. Or Forget It
  153. 153. Or Forget ItCopy Makefile
  154. 154. Or Forget ItCopy MakefileEdit first line
  155. 155. Or Forget ItCopy MakefileEdit first line EXTENSION=pair
  156. 156. Or Forget ItCopy MakefileEdit first line EXTENSION=pairIgnore the rest
  157. 157. %
curl
‐O
http://api.pgxn.org/dist/pair/0.1.2/pair‐0.1.2.pgz%
unzip
pair‐0.1.2.pgz
Archive:

pair‐0.1.2.pgz%
cd
pair‐0.1.2%
  158. 158. %
curl
‐O
http://api.pgxn.org/dist/pair/0.1.2/pair‐0.1.2.pgz%
unzip
pair‐0.1.2.pgz
Archive:

pair‐0.1.2.pgz%
cd
pair‐0.1.2
%
makecp
sql/pair.sql
sql/pair‐‐0.1.2.sqlcp
sql/pair‐‐unpackaged.sql
sql/pair‐‐unpackaged‐‐0.1.2.sql%
sudo
make
install#
…elided%
  159. 159. %
curl
‐O
http://api.pgxn.org/dist/pair/0.1.2/pair‐0.1.2.pgz%
unzip
pair‐0.1.2.pgz
Archive:

pair‐0.1.2.pgz%
cd
pair‐0.1.2
%
makecp
sql/pair.sql
sql/pair‐‐0.1.2.sqlcp
sql/pair‐‐unpackaged.sql
sql/pair‐‐unpackaged‐‐0.1.2.sql%
sudo
make
install#
…elided
%
psql
trypsql
(9.1devel)Type
"help"
for
help.try=#
create
extension
pair;CREATE
EXTENSIONtry=#

  160. 160. %
curl
‐O
http://api.pgxn.org/dist/pair/0.1.2/pair‐0.1.2.pgz%
unzip
pair‐0.1.2.pgz
Archive:

pair‐0.1.2.pgz%
cd
pair‐0.1.2
%
makecp
sql/pair.sql
sql/pair‐‐0.1.2.sqlcp
sql/pair‐‐unpackaged.sql
sql/pair‐‐unpackaged‐‐0.1.2.sql%
sudo
make
install#
…elided
%
psql
trypsql
(9.1devel)Type
"help"
for
help.try=#
create
extension
pair;CREATE
EXTENSION





dTtry=#





List
of
data
types
Schema
|
Name
|
Description
‐‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐‐
public
|
pair
|
(1
row)try=#

  161. 161. %
curl
‐O
http://api.pgxn.org/dist/pair/0.1.2/pair‐0.1.2.pgz%
unzip
pair‐0.1.2.pgz
Archive:

pair‐0.1.2.pgz%
cd
pair‐0.1.2
%
makecp
sql/pair.sql
sql/pair‐‐0.1.2.sqlcp
sql/pair‐‐unpackaged.sql
sql/pair‐‐unpackaged‐‐0.1.2.sql%
sudo
make
install#
…elided
%
psql
trypsql
(9.1devel)Type
"help"
for
help.try=#
create
extension
pair;CREATE
EXTENSION





dTtry=#





List
of
data
types
Schema
|
Name
|
Description
‐‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐‐
public
|
pair
|
(1
row)try=#
 Wow!
  162. 162. Thank you. Releasing Extensions on PGXN David E. Wheeler PostgreSQL Experts, Inc.Text: Attribution-Noncommercial-Share Alike 3.0 United States:http://creativecommons.org/licenses/by-nc-sa/3.0/us/Images licensed independently and © Their respective owners.

×