<?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>gen_random_uuid() &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/gen_random_uuid/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 09 Oct 2017 13:16:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL: Working with Universally Unique Identifier &#8211; UUID Data type</title>
		<link>https://www.dbrnd.com/2016/03/postgresql-working-with-universally-unique-identifier-uuid-data-type/</link>
					<comments>https://www.dbrnd.com/2016/03/postgresql-working-with-universally-unique-identifier-uuid-data-type/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 03 Mar 2016 18:26:32 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[gen_random_uuid()]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[Universally Unique Identifier]]></category>
		<category><![CDATA[UUID]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1893</guid>

					<description><![CDATA[The PostgreSQL provides Universally Unique Identifier -UUID data type and related functions. In the previous post, I shared the truth about Universally Unique Identifier - UUID. You can visit this article here. PostgreSQL provides two extensions. 1. uuid-ossp 2. pgcrypto. You can install above extension using below script. [crayon-6ab55f4054dd1180813543/] I am using pgcrypto extension for [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&amp;linkname=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&amp;linkname=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&amp;linkname=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&amp;linkname=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&amp;linkname=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&amp;linkname=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fpostgresql-working-with-universally-unique-identifier-uuid-data-type%2F&#038;title=PostgreSQL%3A%20Working%20with%20Universally%20Unique%20Identifier%20%E2%80%93%20UUID%20Data%20type" data-a2a-url="https://www.dbrnd.com/2016/03/postgresql-working-with-universally-unique-identifier-uuid-data-type/" data-a2a-title="PostgreSQL: Working with Universally Unique Identifier – UUID Data type"></a></p><p>The PostgreSQL provides Universally Unique Identifier -UUID data type and related functions.</p>
<p><strong><code>In the previous post, I shared the truth about Universally Unique Identifier - UUID.<br />
<a href="https://www.dbrnd.com/2016/03/database-theory-the-truth-about-universally-unique-identifier-uuid/" target="_blank">You can visit this article here</a>.</code></strong></p>
<p>PostgreSQL provides two extensions.</p>
<blockquote><p>1. uuid-ossp<br />
2. pgcrypto.</p></blockquote>
<p>You can install above extension using below script.</p><pre class="crayon-plain-tag">CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS pgcrypto;</pre><p>
I am using pgcrypto extension for generating an UUID.</p>
<p><strong>Below is a small demonstration:</strong></p>
<p><strong>Generate UUID using gen_random_uuid():</strong></p><pre class="crayon-plain-tag">SELECT gen_random_uuid();</pre><p>
<p><strong>Create a sample table with UUID Data type:</strong></p><pre class="crayon-plain-tag">CREATE TABLE tbl_UUIDSample
(  
   MyUUID UUID PRIMARY KEY DEFAULT gen_random_uuid()
   ,Name TEXT   
);</pre><p>
<p><strong>Insert sample data:</strong></p><pre class="crayon-plain-tag">INSERT INTO tbl_UUIDSample (Name)
VALUES
('Anvesh'),('Martin')
,('Roy'),('Jenny')
,('Ronic'),('Monika');</pre><p>
<p><strong>The Result:</strong></p><pre class="crayon-plain-tag">SELECT *FROM tbl_UUIDSample;</pre><p>
<a href="https://www.dbrnd.com/wp-content/uploads/2016/03/PostgreSQLUUID.png" rel="attachment wp-att-1897"><img decoding="async" class="alignnone wp-image-1897 size-full" title="PostgreSQL UUID" src="https://www.dbrnd.com/wp-content/uploads/2016/03/PostgreSQLUUID.png" alt="PostgreSQL UUID" width="311" height="147" srcset="https://www.dbrnd.com/wp-content/uploads/2016/03/PostgreSQLUUID.png 311w, https://www.dbrnd.com/wp-content/uploads/2016/03/PostgreSQLUUID-300x142.png 300w, https://www.dbrnd.com/wp-content/uploads/2016/03/PostgreSQLUUID-150x71.png 150w" sizes="(max-width: 311px) 100vw, 311px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/03/postgresql-working-with-universally-unique-identifier-uuid-data-type/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
