<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UnderworldLabs.org &#187; database</title>
	<atom:link href="http://underworldlabs.org/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://underworldlabs.org</link>
	<description>My Dropbox</description>
	<lastBuildDate>Tue, 20 Mar 2012 23:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>UUID and PostgreSQL</title>
		<link>http://underworldlabs.org/blog/uuid-and-postgresql/</link>
		<comments>http://underworldlabs.org/blog/uuid-and-postgresql/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 05:57:10 +0000</pubDate>
		<dc:creator>Takis Diakoumis</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://underworldlabs.org/?p=162</guid>
		<description><![CDATA[I often use UUID values as secondary identifiers for my domain objects. This is usually generated for my domain entity very simply as follows: java.util.UUID.randomUUID().toString();...]]></description>
			<content:encoded><![CDATA[<p>I often use UUID values as secondary identifiers for my domain objects. This is usually generated for my domain entity very simply as follows:</p>
<pre>java.util.UUID.randomUUID().toString();</pre>
<p>and set directly either as a field variable on instantiation or sometimes in an interceptor on save.</p>
<p>On a recent project we had to migrate some data across some new entities and needed something outside the application to generate the UUID values for each record. I knew that PostgreSQL supported UUID generation &#8211; though I had never used this before &#8211; and even has a <code>UUID</code> data type. Getting to the function itself proved a little more challenging as it isn&#8217;t actually included on a typical installation and is found within the <code>postgres-contrib</code> package. So, to install&#8230;</p>
<pre>
apt-get install postgresql-contrib
sudo su -c "psql pdrivers < /usr/share/postgresql/8.4/contrib/uuid-ossp.sql" postgres
</pre>
<p>The above installs the relevant <code>contrib</code> package, and creates the UUID functions from the script within the unpacked <code>contrib</code> directory (substitute version as required). We are also installing the function as a superuser (<code>postgres</code> in this case) as we need a user with the ability to install functions using <code>C</code> code.</p>
<p>To generate UUID values execute as follows:</p>
<pre>SELECT uuid_generate_v1();

c1b84d24-90c9-11e0-aa50-33cd7e76d901
e9e3b374-90c9-11e0-8f0f-df46bcf47f20
eea6fba0-90c9-11e0-9ce0-a33175edde97
</pre>
<p>Some good references on the available functions can be found <a href="http://www.postgresql.org/docs/9.0/static/uuid-ossp.html">here</a> with some further info on the package <a href="http://www.ossp.org/">OSSP</a> UUID pages <a href="http://www.ossp.org/pkg/lib/uuid/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://underworldlabs.org/blog/uuid-and-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Execute Query</title>
		<link>http://underworldlabs.org/blog/execute-query/</link>
		<comments>http://underworldlabs.org/blog/execute-query/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 23:03:03 +0000</pubDate>
		<dc:creator>Takis Diakoumis</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://underworldlabs.org/?p=13</guid>
		<description><![CDATA[After quite the long slog (over 12 months) and following pesky little things like baby, work and life getting in the way, i&#8217;ve finally managed...]]></description>
			<content:encoded><![CDATA[<p>After quite the long slog (over 12 months) and following pesky little things like baby, work and life getting in the way, i&#8217;ve finally managed to release a new version of Execute Query &#8211; a universal database query (and much more&#8230;) tool.</p>
<p>Check out version 3.1.0 here <a href="http://executequery.org/" target="_blank">http://executequery.org</a><br />
Feedback most welcome. Contributions most welcome.</p>
<p>I do plan for future releases to be more incremental and frequent.</p>
]]></content:encoded>
			<wfw:commentRss>http://underworldlabs.org/blog/execute-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

