<?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/utils/</id><title>Utils</title><updated>2012-04-15T21:44:12Z</updated><link rel="self" type="application/atom+xml" href="https://blog.pgxn.org/tags/utils/feed.xml"/><link rel="alternate" type="text/html" href="https://blog.pgxn.org/tags/utils/"/><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/21171605888</id><title type="html">pgxn-utils 0.1.4 is out!</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2012/pgxn-utils-014-is-out/"/><updated>2026-10-07T16:13:48Z</updated><published>2012-04-15T21:44:12Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="pgxn" label="PGXN"/><category scheme="https://blog.pgxn.org/tags" term="utils" label="Utils"/><category scheme="https://blog.pgxn.org/tags" term="automation" label="Automation"/><category scheme="https://blog.pgxn.org/tags" term="release" label="Release"/><summary type="html"><![CDATA[<p><em>by Dickson S. Guedes</em></p>
<p>Hi everybody!</p>
<p>I&rsquo;m proud to tell you that a new version of <a href="https://github.com/guedes/pgxn-utils">PGXN Utils</a> was released with
this new features:</p>
<ul>
<li>Git support</li>
<li>Templates and custom templates</li>
<li><a href="https://pgxnclient.projects.postgresql.org/">PGXN Client</a> integration</li>
</ul>
<h2 id="git-support">Git support</h2>
<p>You can start a new extension with or without version control. By default
<code>pgxn-utils</code> supports <a href="https://git-scm.org">git</a> but it will not create a repository unless you use
<code>--git</code> option in the skeleton task.</p>
<p>You can try:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> pgxn-utils skeleton my_cool_versioned_extension --git
</span></span></code></pre></div><p>When you create a new extension with git support in addition to creating the
skeleton, <code>pgxn-utils</code> will initialize a git repository and create the initial
commit.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p><em>by Dickson S. Guedes</em></p>
<p>Hi everybody!</p>
<p>I&rsquo;m proud to tell you that a new version of <a href="https://github.com/guedes/pgxn-utils">PGXN Utils</a> was released with
this new features:</p>
<ul>
<li>Git support</li>
<li>Templates and custom templates</li>
<li><a href="https://pgxnclient.projects.postgresql.org/">PGXN Client</a> integration</li>
</ul>
<h2 id="git-support">Git support</h2>
<p>You can start a new extension with or without version control. By default
<code>pgxn-utils</code> supports <a href="https://git-scm.org">git</a> but it will not create a repository unless you use
<code>--git</code> option in the skeleton task.</p>
<p>You can try:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> pgxn-utils skeleton my_cool_versioned_extension --git
</span></span></code></pre></div><p>When you create a new extension with git support in addition to creating the
skeleton, <code>pgxn-utils</code> will initialize a git repository and create the initial
commit.</p>
<p>Once you have your extension in a git repository your <code>bundle</code> will use only
the committed files to create the archive, but if your repository is dirty
then <code>pgxn-utils</code> will suggest that you to commit or stash your changes before
bundling.</p>
<p>You must be careful with new files not added to repository, because they will
<strong>not</strong> be archived.</p>
<h2 id="default-templates">Default templates</h2>
<p>There are three default templates: <code>sql</code>, <code>c</code> and <code>fdw</code>. If you call
<code>skeleton</code> without specifying a template, <code>sql</code> is the default. But if your
extension will supply some C modules or you will create a FDW, you can create
the extension calling <code>skeleton</code> with a <code>--template</code> option.</p>
<p>Try:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> pgxn-utils skeleton my_cool_c_extension --template<span class="o">=</span>c
</span></span><span class="line"><span class="cl"><span class="gp">$</span> pgxn-utils skeleton my_cool_fdw_extension --template<span class="o">=</span>fdw
</span></span></code></pre></div><p>The templates contain example code and some links to PostgreSQL documentation
that will try to help you to start coding. SQL and C templates contains some
test examples, and the example code will compile and pass <code>make installcheck</code>.
However, this code is intended to be an example, and you must write your own
tests and code.</p>
<h2 id="custom-templates">Custom templates</h2>
<p>If you don&rsquo;t like the templates provided by <code>pgxn-utils</code> you can create you
own. Just create a directory with at least a <code>META.json</code> or <code>META.json.tt</code>
file and then use your directory as argument to the <code>--template</code> option.</p>
<p>To know how create your own template, see the examples in the <a href="https://github.com/guedes/pgxn-utils/tree/master/lib/pgxn_utils/templates">templates
directory</a>.</p>
<h2 id="pgxn-client-integration">PGXN Client integration</h2>
<p>If you have <a href="https://pgxnclient.projects.postgresql.org/">PGXN client</a> installed you can change the command line from
<code>pgxn-utils some_task</code> to <code>pgxn some_task</code> and this will save you some typing.</p>
<p>See:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> <span class="nb">cd</span> /tmp
</span></span><span class="line"><span class="cl"><span class="gp">$</span> pgxn skeleton --help
</span></span><span class="line"><span class="cl"><span class="go">PGXN Utils version: 0.1.4
</span></span></span><span class="line"><span class="cl"><span class="go">Usage:
</span></span></span><span class="line"><span class="cl"><span class="go">  pgxn skeleton extension_name
</span></span></span><span class="line"><span class="cl"><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="go">Options:
</span></span></span><span class="line"><span class="cl"><span class="go">      [--git]                            # Initialize a git repository after create the extension
</span></span></span><span class="line"><span class="cl"><span class="go">  -a, [--abstract=ABSTRACT]              # Defines a short description to abstract
</span></span></span><span class="line"><span class="cl"><span class="go">  -p, [--target=TARGET]                  # Define the target directory
</span></span></span><span class="line"><span class="cl"><span class="go">                                          # Default: .
</span></span></span><span class="line"><span class="cl"><span class="go">      [--template=TEMPLATE]              # The template that will be used to create the extension. Expected values are: sql, c, fdw
</span></span></span><span class="line"><span class="cl"><span class="go">                                          # Default: sql
</span></span></span><span class="line"><span class="cl"><span class="go">  -r, [--release-status=RELEASE_STATUS]  # Initial extension&#39;s release status
</span></span></span><span class="line"><span class="cl"><span class="go">  -d, [--description=DESCRIPTION]        # A long text that contains more information about extension
</span></span></span><span class="line"><span class="cl"><span class="go">  -b, [--generated-by=GENERATED_BY]      # Name of extension&#39;s generator
</span></span></span><span class="line"><span class="cl"><span class="go">  -l, [--license=LICENSE]                # The extension license
</span></span></span><span class="line"><span class="cl"><span class="go">  -t, [--tags=one two three]             # Defines extension&#39;s tags
</span></span></span><span class="line"><span class="cl"><span class="go">  -v, [--version=VERSION]                # Initial version
</span></span></span><span class="line"><span class="cl"><span class="go">  -m, [--maintainer=MAINTAINER]          # Maintainer&#39;s name &lt;maintainer@email&gt;
</span></span></span><span class="line"><span class="cl"><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="go">Creates an extension skeleton in current directory
</span></span></span><span class="line"><span class="cl"><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="gp">$</span> pgxn skeleton <span class="nb">test</span>
</span></span><span class="line"><span class="cl"><span class="go">      create  test
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/test.control
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/.gitignore
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/.template
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/META.json
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/Makefile
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/README.md
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/doc/test.md
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/sql/test.sql
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/sql/uninstall_test.sql
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/test/expected/base.out
</span></span></span><span class="line"><span class="cl"><span class="go">      create  test/test/sql/base.sql
</span></span></span><span class="line"><span class="cl"><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="gp">$</span> <span class="nb">cd</span> test/
</span></span><span class="line"><span class="cl"><span class="gp">$</span> pgxn bundle
</span></span><span class="line"><span class="cl"><span class="go">          run  make distclean from &#34;.&#34;
</span></span></span><span class="line"><span class="cl"><span class="go">      create  /tmp/test-0.0.1.zip
</span></span></span></code></pre></div><p>I hope you enjoy this version. &ldquo;:)</p>
]]></content></entry><entry><id>https://blog.pgxn.org/post/9950473714</id><title type="html">PGXN Utils 0.1.3 Released!</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2011/pgxn-utils-013-released/"/><updated>2026-10-07T16:13:48Z</updated><published>2011-09-08T06:39:00Z</published><author><name>Dickson S. Guedes</name></author><category scheme="https://blog.pgxn.org/tags" term="pgxn-utils" label="PGXN Utils"/><category scheme="https://blog.pgxn.org/tags" term="development" label="Development"/><category scheme="https://blog.pgxn.org/tags" term="utils" label="Utils"/><category scheme="https://blog.pgxn.org/tags" term="build" label="Build"/><category scheme="https://blog.pgxn.org/tags" term="bundle-extension" label="Bundle Extension"/><category scheme="https://blog.pgxn.org/tags" term="meta" label="Meta"/><summary type="html"><![CDATA[<p>Hello everyone!</p>
<p>I&rsquo;m proud to tell you that a new version of <a href="https://github.com/guedes/pgxn-utils">pgxn_utils</a> was released!</p>
<p>In this version some errors with OpenSSL was fixed (thanks @theory to report
then), and now you can release an extension to <a href="https://pgxn.org">PGXN</a> <a href="https://blog.pgxn.org/post/6883009649/pgxn-utils-0-1-2-released">in <strong>five steps</strong></a>
even using Ruby 1.8!</p>
<p>Another change was the executable&rsquo;s name that changed from <code>pgxn_utils</code> to
<code>pgxn-utils</code> for a close integration with next version of <a href="https://pgxnclient.projects.postgresql.org">PGXN Client</a>, but
some work need to be done, yet.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>Hello everyone!</p>
<p>I&rsquo;m proud to tell you that a new version of <a href="https://github.com/guedes/pgxn-utils">pgxn_utils</a> was released!</p>
<p>In this version some errors with OpenSSL was fixed (thanks @theory to report
then), and now you can release an extension to <a href="https://pgxn.org">PGXN</a> <a href="https://blog.pgxn.org/post/6883009649/pgxn-utils-0-1-2-released">in <strong>five steps</strong></a>
even using Ruby 1.8!</p>
<p>Another change was the executable&rsquo;s name that changed from <code>pgxn_utils</code> to
<code>pgxn-utils</code> for a close integration with next version of <a href="https://pgxnclient.projects.postgresql.org">PGXN Client</a>, but
some work need to be done, yet.</p>
<p>I used <code>pgxn-utils</code> to release itself to <a href="https://pgxn.org/dist/pgxn_utils/">PGXN</a>!</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> pgxn-utils release pgxn_utils-0.1.3.zip 
</span></span><span class="line"><span class="cl"><span class="go">Enter your PGXN username: guedes
</span></span></span><span class="line"><span class="cl"><span class="go">Enter your PGXN password: ***********************
</span></span></span><span class="line"><span class="cl"><span class="go">Trying to release pgxn_utils-0.1.3.zip ... released successfully!
</span></span></span><span class="line"><span class="cl"><span class="go">Visit: https://pgxn.org/dist/pgxn_utils/0.1.3/
</span></span></span></code></pre></div><p>Cool, eh? So, since the PGXN&rsquo;s mirrors were synced and you have <code>pgxn</code> client,
you could install <code>pgxn_utils</code> using:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">pgxn install pgxn_utils
</span></span></code></pre></div><p>If you don&rsquo;t have <code>pgxn</code> client you can install it using rubygems</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">gem install pgxn_utils
</span></span></code></pre></div><p>Have fun!</p>
]]></content></entry><entry><id>https://blog.pgxn.org/post/6883009649</id><title type="html">PGXN Utils 0.1.2 Released!</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2011/pgxn-utils-012-released/"/><updated>2026-10-07T16:13:48Z</updated><published>2011-06-24T23:53:00Z</published><author><name>Dickson S. Guedes</name></author><category scheme="https://blog.pgxn.org/tags" term="build" label="Build"/><category scheme="https://blog.pgxn.org/tags" term="create-extension" label="Create Extension"/><category scheme="https://blog.pgxn.org/tags" term="utils" label="Utils"/><category scheme="https://blog.pgxn.org/tags" term="meta" label="Meta"/><category scheme="https://blog.pgxn.org/tags" term="release" label="Release"/><category scheme="https://blog.pgxn.org/tags" term="bundle" label="Bundle"/><summary type="html"><![CDATA[<p>Hello everyone!</p>
<p>I&rsquo;m proud to tell you that a new version of <a href="https://github.com/guedes/pgxn-utils">pgxn_utils</a> was released!</p>
<p>Now you can release a distribution to <a href="https://pgxn.org">PGXN</a> in <strong>five steps</strong>!</p>
<p><strong>First</strong>, install it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">gem install pgxn_utils
</span></span></code></pre></div><p><strong>Second</strong>, create your extension, optionally overwrite some defaults:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">mkdir <span class="nv">$HOME</span>/extensions
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> <span class="nv">$HOME</span>/extensions
</span></span><span class="line"><span class="cl">pgxn_utils skeleton my_extension --maintainer <span class="s2">&#34;Dickson S. Guedes&#34;</span>
</span></span></code></pre></div><p><strong>Third</strong>, code!</p>
<p><strong>Fourth</strong>, bundle it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="go">pgxn_utils bundle my_extension
</span></span></span><span class="line"><span class="cl"><span class="go">Extension generated at: /home/guedes/extensions/my_extension-0.0.1.zip
</span></span></span></code></pre></div><p><strong>Fifth</strong>, release it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="go">pgxn_utils release my_extension-0.0.1.zip
</span></span></span><span class="line"><span class="cl"><span class="go">Enter your PGXN username: guedes
</span></span></span><span class="line"><span class="cl"><span class="go">Enter your PGXN password: ******
</span></span></span><span class="line"><span class="cl"><span class="go">Trying to release my_cool_extension-0.0.1.zip ... released successfully!
</span></span></span><span class="line"><span class="cl"><span class="go">Visit: https://manager.pgxn.org/distributions/my_cool_extension/0.0.1
</span></span></span></code></pre></div><p>Ah, you can export <code>PGXN_USER</code> and <code>PGXN_PASSWORD</code> if you are tired to type
your username and password every time.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>Hello everyone!</p>
<p>I&rsquo;m proud to tell you that a new version of <a href="https://github.com/guedes/pgxn-utils">pgxn_utils</a> was released!</p>
<p>Now you can release a distribution to <a href="https://pgxn.org">PGXN</a> in <strong>five steps</strong>!</p>
<p><strong>First</strong>, install it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">gem install pgxn_utils
</span></span></code></pre></div><p><strong>Second</strong>, create your extension, optionally overwrite some defaults:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">mkdir <span class="nv">$HOME</span>/extensions
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> <span class="nv">$HOME</span>/extensions
</span></span><span class="line"><span class="cl">pgxn_utils skeleton my_extension --maintainer <span class="s2">&#34;Dickson S. Guedes&#34;</span>
</span></span></code></pre></div><p><strong>Third</strong>, code!</p>
<p><strong>Fourth</strong>, bundle it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="go">pgxn_utils bundle my_extension
</span></span></span><span class="line"><span class="cl"><span class="go">Extension generated at: /home/guedes/extensions/my_extension-0.0.1.zip
</span></span></span></code></pre></div><p><strong>Fifth</strong>, release it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="go">pgxn_utils release my_extension-0.0.1.zip
</span></span></span><span class="line"><span class="cl"><span class="go">Enter your PGXN username: guedes
</span></span></span><span class="line"><span class="cl"><span class="go">Enter your PGXN password: ******
</span></span></span><span class="line"><span class="cl"><span class="go">Trying to release my_cool_extension-0.0.1.zip ... released successfully!
</span></span></span><span class="line"><span class="cl"><span class="go">Visit: https://manager.pgxn.org/distributions/my_cool_extension/0.0.1
</span></span></span></code></pre></div><p>Ah, you can export <code>PGXN_USER</code> and <code>PGXN_PASSWORD</code> if you are tired to type
your username and password every time.</p>
<p><a href="https://github.com/guedes/pgxn-utils">Check this out!</a>.</p>
]]></content></entry><entry><id>https://blog.pgxn.org/post/5758832725</id><title type="html">PGXN Utils 0.1.1 Released!</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2011/pgxn-utils-011-released/"/><updated>2026-10-07T16:13:48Z</updated><published>2011-05-23T04:53:30Z</published><author><name>Dickson S. Guedes</name></author><category scheme="https://blog.pgxn.org/tags" term="build" label="Build"/><category scheme="https://blog.pgxn.org/tags" term="create-extension" label="Create Extension"/><category scheme="https://blog.pgxn.org/tags" term="utils" label="Utils"/><category scheme="https://blog.pgxn.org/tags" term="bundle-extension" label="Bundle Extension"/><category scheme="https://blog.pgxn.org/tags" term="meta" label="Meta"/><category scheme="https://blog.pgxn.org/tags" term="readme" label="README"/><category scheme="https://blog.pgxn.org/tags" term="skeleton" label="Skeleton"/><summary type="html"><![CDATA[<p>Hello everyone!</p>
<p>This was a productive weekend that allowed me to work on some new features in
<a href="https://github.com/guedes/pgxn-utils">pgxn_utils</a> and I&rsquo;m proud to tell you that a new version was released!</p>
<p>Trying to simplify your extension-development life I&rsquo;ve added two tasks to
<code>pgxn_utils</code>: <code>change</code> and <code>bundle</code>. The first one is just a convenient way to
change META information about extension, incrementally, the second one is an
easy way to archive your extension in a zip file well named.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>Hello everyone!</p>
<p>This was a productive weekend that allowed me to work on some new features in
<a href="https://github.com/guedes/pgxn-utils">pgxn_utils</a> and I&rsquo;m proud to tell you that a new version was released!</p>
<p>Trying to simplify your extension-development life I&rsquo;ve added two tasks to
<code>pgxn_utils</code>: <code>change</code> and <code>bundle</code>. The first one is just a convenient way to
change META information about extension, incrementally, the second one is an
easy way to archive your extension in a zip file well named.</p>
<p>To install it just type:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">gem install pgxn_utils
</span></span></code></pre></div><p>Or, if you don&rsquo;t want to install it yet, see it in action on this <a href="https://blip.tv/pgcasts/pgxn_utils-0-1-1-released-5194610">screencast</a>
3:05.</p>
<p><strong>Work in progress&hellip;</strong></p>
<p>I&rsquo;m working now to simplify the release, creating a task to send bundled file
to <a href="https://pgxn.org">PGXN</a>.</p>
<p>There are a lot of work to do yet so, please, <a href="https://github.com/guedes/pgxn-utils/issues">tell me</a> if you found a bug or
have suggestions.</p>
<p>Have a nice code! &ldquo;:)</p>
]]></content></entry></feed>