<?xml version="1.0" encoding="UTF-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><id>https://blog.pgxn.org/tags/david-golden/</id><title>David Golden</title><updated>2010-08-17T13:00:00Z</updated><link rel="self" type="application/atom+xml" href="https://blog.pgxn.org/tags/david-golden/feed.xml"/><link rel="alternate" type="text/html" href="https://blog.pgxn.org/tags/david-golden/"/><author><name>The PGXN Maintainers</name></author><generator uri="https://gohugo.io/" version="0.167.0">Hugo</generator><entry><id>https://blog.pgxn.org/post/966989188</id><title type="html">RFC: The PGXN Metadata Specification</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2010/meta-spec-rfc/"/><updated>2026-10-07T16:13:48Z</updated><published>2010-08-17T13:00:00Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="meta" label="Meta"/><category scheme="https://blog.pgxn.org/tags" term="meta-spec" label="Meta Spec"/><category scheme="https://blog.pgxn.org/tags" term="metadata" label="Metadata"/><category scheme="https://blog.pgxn.org/tags" term="json" label="JSON"/><category scheme="https://blog.pgxn.org/tags" term="cpan-meta-spec" label="CPAN Meta Spec"/><category scheme="https://blog.pgxn.org/tags" term="david-golden" label="David Golden"/><category scheme="https://blog.pgxn.org/tags" term="version-numbers" label="Version Numbers"/><category scheme="https://blog.pgxn.org/tags" term="prerequisites" label="Prerequisites"/><category scheme="https://blog.pgxn.org/tags" term="license" label="License"/><summary type="html"><![CDATA[<p>I&rsquo;ve posted a draft of the &ldquo;PGXN distribution metadata specification,&rdquo; or
<a href="https://github.com/theory/pgxn/wiki/PGXN-Meta-Spec">PGXN Meta Spec</a>.&quot; This document specifies the structure and format of the
<code>META.json</code> file that PGXN will require in every distribution. In fact, this
is the <em>only</em> required file in a distribution. Its job is to describe the
distribution, its extensions, and its dependencies, among other things. This
file is key to the whole thing.</p>
<p>To create it, I&rsquo;ve ported the <a href="https://search.cpan.org/perldoc?CPAN::Meta::Sepc">CPAN Meta Spec</a>, version 2, but with all
deprecated fields removed, and some of the more complex stuff taken out. I
also made a couple of the &ldquo;required&rdquo; fields &ldquo;optional.&rdquo; At its simplest, the
file might look something like this:</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>I&rsquo;ve posted a draft of the &ldquo;PGXN distribution metadata specification,&rdquo; or
<a href="https://github.com/theory/pgxn/wiki/PGXN-Meta-Spec">PGXN Meta Spec</a>.&quot; This document specifies the structure and format of the
<code>META.json</code> file that PGXN will require in every distribution. In fact, this
is the <em>only</em> required file in a distribution. Its job is to describe the
distribution, its extensions, and its dependencies, among other things. This
file is key to the whole thing.</p>
<p>To create it, I&rsquo;ve ported the <a href="https://search.cpan.org/perldoc?CPAN::Meta::Sepc">CPAN Meta Spec</a>, version 2, but with all
deprecated fields removed, and some of the more complex stuff taken out. I
also made a couple of the &ldquo;required&rdquo; fields &ldquo;optional.&rdquo; At its simplest, the
file might look something like this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;pgTAP&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;abstract&#34;</span><span class="p">:</span> <span class="s2">&#34;Unit testing for PostgreSQL&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.25.0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;owner&#34;</span><span class="p">:</span> <span class="s2">&#34;David E. Wheeler &lt;theory@pgxn.org&gt;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;license&#34;</span><span class="p">:</span> <span class="s2">&#34;postgresql&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;meta-spec&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;1.0.0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;url&#34;</span><span class="p">:</span> <span class="s2">&#34;https://github.com/theory/pgxn/wiki/PGXN-Meta-Spec&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>Not too bad, eh? The URL for the spec might change (might move it to the main
site and/or the mirrors), but otherwise, I think this is pretty solid. Not too
much work to deal with, and reasonably easy to create by hand (which is likely
how we&rsquo;ll all start out).</p>
<p>And additional key that will be really important for the PGXN client is
<code>prereqs</code>. This key allows you to identify the prerequisites (from PGXN or the
PostgreSQL core contrib extensions) required to build, test, and/or use a
distribution. For example, if I were to release an <a href="https://justatheory.com/computers/databases/postgresql/key-value-pairs.html">ordered pair</a> extension,
it of course would include tests written with <a href="https://pgtap.org/">pgTAP</a>. So I&rsquo;d have something
like:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;abstract&#34;</span><span class="p">:</span> <span class="s2">&#34;An ordered pair data type&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.1.0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;owner&#34;</span><span class="p">:</span> <span class="s2">&#34;David E. Wheeler &lt;theory@pgxn.org&gt;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="err">license:</span> <span class="nt">&#34;postgresql&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;meta-spec&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;1.0.0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;url&#34;</span><span class="p">:</span> <span class="s2">&#34;https://github.com/theory/pgxn/wiki/PGXN-Meta-Spec&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">},</span>
</span></span><span class="line"><span class="cl">  <span class="nt">&#34;prereqs&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;runtime&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;requires&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="nt">&#34;PostgreSQL&#34;</span><span class="p">:</span> <span class="s2">&#34;8.0.0&#34;</span>
</span></span><span class="line"><span class="cl">      <span class="p">},</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;recommends&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="nt">&#34;PostgreSQL&#34;</span><span class="p">:</span> <span class="s2">&#34;8.4.0&#34;</span>
</span></span><span class="line"><span class="cl">      <span class="p">}</span>
</span></span><span class="line"><span class="cl">    <span class="p">},</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;test&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;requires&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="nt">&#34;pgTAP&#34;</span><span class="p">:</span> <span class="mi">0</span>
</span></span><span class="line"><span class="cl">      <span class="p">}</span>
</span></span><span class="line"><span class="cl">    <span class="p">}</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>That&rsquo;s saying that the &ldquo;pair&rdquo; distribution requires PostgreSQL 8.0.0 or higher
and any version of pgTAP to run the test suite. I&rsquo;ve also recommended
PostgreSQL 8.4, as that&rsquo;s where it will run best.</p>
<p>Of course, to get the real power of PGXN, you&rsquo;ll also want to use the
<code>provides</code> key, which allows you to identify the extensions included in your
distribution. Say that I finally got around to breaking out the schema testing
assertions from the logical testing assertions in pgTAP. I might call the
second module &ldquo;schematap.&rdquo; So to spell it out, I&rsquo;d add this to the first
example above:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl">  <span class="s2">&#34;pgtap&#34;</span><span class="err">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;file&#34;</span><span class="p">:</span> <span class="s2">&#34;sql/pgtap.sql.in&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.25.0&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span><span class="err">,</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;schematap&#34;</span><span class="err">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;file&#34;</span><span class="p">:</span> <span class="s2">&#34;sql/schematap.sql.in&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span>
</span></span></code></pre></div><p>So now the indexer will know that the &ldquo;pgtap&rdquo; extension is in
<code>sql/pgtap.sql.in</code> and the &ldquo;schematap&rdquo; extension is in <code>sql/schematap.sql.in</code>.
This is important because it allows other distributions to specify &ldquo;schematap&rdquo;
as a prerequisite. It also means that, in the PGXN client, you can type
something like:</p>
<pre tabindex="0"><code>PGXN&gt; install schematap
</code></pre><p>And, because &ldquo;schematap&rdquo; will have been indexed on the network, the client
will be able to find the pgTAP distribution and install it, complete with the
&ldquo;schematap&rdquo; extension.</p>
<p>A final note. Version numbers in the Perl community are a <a href="https://www.dagolden.com/index.php/369/version-numbers-should-be-boring/" title="Version numbers should be boring">disaster</a>. Wanting
to avoid that whole morass, I had originally intended to require numeric
version numbers. But <a href="https://www.dagolden.com/">David Golden</a> &ndash; the current maintainer of the CPAN Meta
Spec &ndash; pointed me to <a href="https://semver.org/">Semantic Versioning</a>, a version number specification by
GitHub&rsquo;s <a href="https://tom.preston-werner.com/">Tom Preston-Werner</a>. This style of version numbering is great for
PGXN for a few reasons:</p>
<ul>
<li>It closely matches how PostgreSQL itself is versioned.</li>
<li>It&rsquo;s very easy to compare version strings.</li>
<li>Someone else has already dealt with the pain of writing a spec</li>
</ul>
<p>So this is the standard that PGXN will require. Every version number will be
dotted-integer with three integers (X.Y.Z) and an optional ASCII string at the
end. That&rsquo;s it. PGXN won&rsquo;t invest any special meaning in the version string
the way CPAN does. It will just compare version numbers.</p>
<p>Anyway, please review <a href="https://github.com/theory/pgxn/wiki/PGXN-Meta-Spec">the spec</a> itself and leave any comments
or questions below. I expect to start hacking on this stuff this week!</p>
<p><strong>Update 2010-08-24:</strong> I&rsquo;ve just updated <a href="https://github.com/theory/pgxn/wiki/PGXN-Meta-Spec">the spec</a> to change
&ldquo;owner&rdquo; to &ldquo;maintainer.&rdquo; I think that the latter term is much better for this
purpose. And then I can use &ldquo;owner&rdquo; in PGXN to identify the person who uploads
a distribution.</p>
]]></content></entry></feed>