61. The Steps
Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
62. The Steps
Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
Write the docs
63. The Steps
Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
Write the docs
Create the metadata file
64. The Steps
Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
Write the docs
Create the metadata file
Package it up
65. The Steps
Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
Write the docs
Create the metadata file
Package it up
Release
77. Stub the Docs
pair 0.1.0
doc/pair.txt
==========
Synopsis
‐‐‐‐‐‐‐‐
‐‐ Example code here.
Description
‐‐‐‐‐‐‐‐‐‐‐
This library blah blah blah...
Usage
‐‐‐‐‐
Here's how to use this library.
Author
‐‐‐‐‐‐
[David E. Wheeler](http://justatheory.com/)
Copyright
‐‐‐‐‐‐‐‐‐
Copyright (c) 2010 David E. Wheeler.
test/sql/base.sql
93. Give it a Try
make
%
make: Nothing to be done for `all'.
%
94. Give it a Try
make
%
make: Nothing to be done for `all'.
make installcheck
%
pg_regress ‐‐psqldir=/pgsql/bin ‐‐inputdir=test base
=== dropping database "regression" ===
DROP DATABASE
=== creating database "regression" ===
CREATE DATABASE
ALTER DATABASE
=== running regression test queries ===
test base ... diff:
test/expected/base.out: No such file or directory
diff command failed with status 512:
diff "test/expected/base.out" "results/base.out" >
"results/base.out.diff"
make: *** [installcheck] Error 2
%
95. Give it a Try
make
%
make: Nothing to be done for `all'.
make installcheck
%
pg_regress ‐‐psqldir=/pgsql/bin ‐‐inputdir=test base
=== dropping database "regression" ===
DROP DATABASE
=== creating database "regression" ===
CREATE DATABASE
ALTER DATABASE
=== running regression test queries ===
test base ... diff:
test/expected/base.out: No such file or directory
diff command failed with status 512:
diff "test/expected/base.out" "results/base.out" >
"results/base.out.diff"
make: *** [installcheck] Error 2
%
96. Give it a Try
make
%
make: Nothing to be done for `all'.
make installcheck
%
pg_regress ‐‐psqldir=/pgsql/bin ‐‐inputdir=test base
=== dropping database "regression" ===
DROP DATABASE
=== creating database "regression" ===
We’ll come
CREATE DATABASE
ALTER DATABASE
back to that.
=== running regression test queries ===
test base ... diff:
test/expected/base.out: No such file or directory
diff command failed with status 512:
diff "test/expected/base.out" "results/base.out" >
"results/base.out.diff"
make: *** [installcheck] Error 2
%
147. Where are We?
Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
Write the docs
Create the metadata file
Package it up
Release
148. Where are We?
✔ Stub source, test, and doc files
Create the Makefile
Write the tests
Write the code
Write the docs
Create the metadata file
Package it up
Release
149. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
Write the tests
Write the code
Write the docs
Create the metadata file
Package it up
Release
150. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
Write the code
Write the docs
Create the metadata file
Package it up
Release
151. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
Write the docs
Create the metadata file
Package it up
Release
170. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
Write the docs
Create the metadata file
Package it up
Release
171. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
✔ Write the docs
Create the metadata file
Package it up
Release
172. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
✔ Write the docs
✔ Create the metadata file
Package it up
Release
173. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
✔ Write the docs
✔ Create the metadata file
✔ Package it up
Release
203. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
✔ Write the docs
✔ Create the metadata file
✔ Package it up
Release
204. Where are We?
✔ Stub source, test, and doc files
✔ Create the Makefile
✔ Write the tests
✔ Write the code
✔ Write the docs
✔ Create the metadata file
✔ Package it up
✔ Release
209. Why PGXN?
World-wide network of mirrors
Fully indexed extensions
RESTful metadata distribution
Search and documentation site
210. Why PGXN?
World-wide network of mirrors
Fully indexed extensions
RESTful metadata distribution
Search and documentation site
Comprehensive REST API
211. Why PGXN?
World-wide network of mirrors
Fully indexed extensions
RESTful metadata distribution
Search and documentation site
Comprehensive REST API
Command-line client
226. Coming in 9.1
9.1 adding extension support
CREATE EXTENSION pair WITH SCHEMA utils;
227. Coming in 9.1
9.1 adding extension support
CREATE EXTENSION pair WITH SCHEMA utils;
Encapsulates dump/restore
228. Coming in 9.1
9.1 adding extension support
CREATE EXTENSION pair WITH SCHEMA utils;
Encapsulates dump/restore
Whatever is defined in the SQL script
229. Coming in 9.1
9.1 adding extension support
CREATE EXTENSION pair WITH SCHEMA utils;
Encapsulates dump/restore
Whatever is defined in the SQL script
Supporting it is easy
249. 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‐‐unpac…
250. 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…
274. Skeleton in the Closet
%
sudo gem install pgxn_utils
Installing ri documentation for pgxn_utils‐0.1.2...
Installing RDoc documentation for pgxn_utils‐0.1.2...
%
275. Skeleton in the Closet
%
sudo gem install pgxn_utils
Installing ri documentation for pgxn_utils‐0.1.2...
Installing RDoc documentation for pgxn_utils‐0.1.2...
pgxn_utils skeleton semver
%
create semver
create semver/semver.control
create semver/META.json
create semver/Makefile
create semver/README.md
create semver/doc/semver.md
create semver/sql/semver.sql
create semver/sql/uninstall_semver.sql
create semver/test/expected/base.out
create semver/test/sql/base.sql
%