<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Converting from UUIDs to GUIDs &#8211; Solution</title>
	<atom:link href="http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution</link>
	<description></description>
	<lastBuildDate>Thu, 01 Jun 2017 18:51:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Felecia Berger</title>
		<link>http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution/comment-page-1#comment-53481</link>
		<dc:creator>Felecia Berger</dc:creator>
		<pubDate>Fri, 09 Jan 2009 20:34:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=437#comment-53481</guid>
		<description>hi
2xlv4cmgqfwmskfa
good luck</description>
		<content:encoded><![CDATA[<p>hi<br />
2xlv4cmgqfwmskfa<br />
good luck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution/comment-page-1#comment-53093</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Wed, 24 Dec 2008 21:39:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=437#comment-53093</guid>
		<description>@Andrew - CF handles it implicitly (at least on my default CF8 install).  The following code:

&lt;pre&gt;&lt;code&gt;
&lt;cfquery datasource=&quot;dsn&quot; name=&quot;uuidtest&quot;&gt;
	SELECT *
	FROM uuidtest
&lt;/cfquery&gt;
&lt;cfoutput&gt;#uuidtest.uidTest#: #yesNoFormat(isValid(&#039;guid&#039;, uuidtest.uidTest))#&lt;/cfoutput&gt;
&lt;/code&gt;&lt;/pre&gt;

Outputs:

&lt;code&gt;c5f25cc3-1d72-822b-7957-06e5a2c8f6b1: Yes&lt;/code&gt;

No problems whatsoever - are you seeing something different?</description>
		<content:encoded><![CDATA[<p>@Andrew &#8211; CF handles it implicitly (at least on my default CF8 install).  The following code:</p>
<pre><code>
&lt;cfquery datasource="dsn" name="uuidtest"&gt;
	SELECT *
	FROM uuidtest
&lt;/cfquery&gt;
&lt;cfoutput&gt;#uuidtest.uidTest#: #yesNoFormat(isValid('guid', uuidtest.uidTest))#&lt;/cfoutput&gt;
</code></pre>
<p>Outputs:</p>
<p><code>c5f25cc3-1d72-822b-7957-06e5a2c8f6b1: Yes</code></p>
<p>No problems whatsoever &#8211; are you seeing something different?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution/comment-page-1#comment-53070</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 24 Dec 2008 13:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=437#comment-53070</guid>
		<description>If you want to use GUIDs in CF then one of the biggest problems is CF&#039;s lack of support for the PG UUID data type.  I haven&#039;t figured out a nice way to handle the PGobjects that are returned in a cfquery when you select a UUID column.  That&#039;s the main reason that I thought about using the above functions.</description>
		<content:encoded><![CDATA[<p>If you want to use GUIDs in CF then one of the biggest problems is CF&#8217;s lack of support for the PG UUID data type.  I haven&#8217;t figured out a nice way to handle the PGobjects that are returned in a cfquery when you select a UUID column.  That&#8217;s the main reason that I thought about using the above functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution/comment-page-1#comment-53063</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Tue, 23 Dec 2008 18:00:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=437#comment-53063</guid>
		<description>@Andrew - you could definitely do that although you would have to update all of your queries to use those new functions.  If you only have a few UUID fields, you might simply wait for PostgreSQL 8.4 which will accept the CF format on input and then use the function above or my regex to add the hyphen and upper() on output.

The more I look at it, the more I think of it as switching from UUID to GUIDs.  ColdFusion&#039;s UUID generator is terribly slow anyways and using the 36-character UUID/GUID makes the database and the application more compatible with the rest of the Interweb.  

It&#039;s easy to generate GUIDs with ColdFusion and there is an isValid() function for them... those eliminate the barriers in my mind.</description>
		<content:encoded><![CDATA[<p>@Andrew &#8211; you could definitely do that although you would have to update all of your queries to use those new functions.  If you only have a few UUID fields, you might simply wait for PostgreSQL 8.4 which will accept the CF format on input and then use the function above or my regex to add the hyphen and upper() on output.</p>
<p>The more I look at it, the more I think of it as switching from UUID to GUIDs.  ColdFusion&#8217;s UUID generator is terribly slow anyways and using the 36-character UUID/GUID makes the database and the application more compatible with the rest of the Interweb.  </p>
<p>It&#8217;s easy to generate GUIDs with ColdFusion and there is an isValid() function for them&#8230; those eliminate the barriers in my mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.ghidinelli.com/2008/12/20/converting-from-uuids-to-guids-solution/comment-page-1#comment-53062</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 23 Dec 2008 15:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=437#comment-53062</guid>
		<description>I&#039;ve been thinking about converting CF UUIDs to PG&#039;s UUIDs, and I was wondering if you&#039;d considered the following:

I only have a couple cf uuid columns in my database, so I was thinking of wrapping any sql that accesses the columns with functions like:

CREATE OR REPLACE FUNCTION pg_uuid_to_cf_uuid(uuid) RETURNS text AS
	&#039;SELECT substring($1::text, 0, 24) &#124;&#124; substring($1::text, 25)&#039;
LANGUAGE &#039;sql&#039; IMMUTABLE STRICT;

CREATE OR REPLACE FUNCTION cf_uuid_to_pg_uuid(text) RETURNS uuid AS
	&#039;SELECT (substring($1, 0, 24) &#124;&#124; &#039;&#039;-&#039;&#039; &#124;&#124; substring($1, 24))::uuid&#039;
LANGUAGE &#039;sql&#039; IMMUTABLE STRICT;


Since I convert all the values at the DB level I can still use CF&#039;s uuid functions...

Alternatively, I was thinking of creating the equivalent functions in CF, and use the functions in all my cfqueries... but then I couldn&#039;t figure out a nice way to handle the selects that return PGobjects for the uuid columns.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been thinking about converting CF UUIDs to PG&#8217;s UUIDs, and I was wondering if you&#8217;d considered the following:</p>
<p>I only have a couple cf uuid columns in my database, so I was thinking of wrapping any sql that accesses the columns with functions like:</p>
<p>CREATE OR REPLACE FUNCTION pg_uuid_to_cf_uuid(uuid) RETURNS text AS<br />
	&#8216;SELECT substring($1::text, 0, 24) || substring($1::text, 25)&#8217;<br />
LANGUAGE &#8217;sql&#8217; IMMUTABLE STRICT;</p>
<p>CREATE OR REPLACE FUNCTION cf_uuid_to_pg_uuid(text) RETURNS uuid AS<br />
	&#8216;SELECT (substring($1, 0, 24) || &#8221;-&#8221; || substring($1, 24))::uuid&#8217;<br />
LANGUAGE &#8217;sql&#8217; IMMUTABLE STRICT;</p>
<p>Since I convert all the values at the DB level I can still use CF&#8217;s uuid functions&#8230;</p>
<p>Alternatively, I was thinking of creating the equivalent functions in CF, and use the functions in all my cfqueries&#8230; but then I couldn&#8217;t figure out a nice way to handle the selects that return PGobjects for the uuid columns.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
