<?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>underdog-blog &#187; plpgsql</title>
	<atom:link href="http://blog.underdog-projects.net/tag/plpgsql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.underdog-projects.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 23 Oct 2010 18:43:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>get hostname from url as stored procedure in plpgsql</title>
		<link>http://blog.underdog-projects.net/2009/06/get-hostname-from-url-as-stored-procedure-in-plpgsql/</link>
		<comments>http://blog.underdog-projects.net/2009/06/get-hostname-from-url-as-stored-procedure-in-plpgsql/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 22:38:35 +0000</pubDate>
		<dc:creator>jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://blog.underdog-projects.net/?p=346</guid>
		<description><![CDATA[I just needed a simple stored procedure to extract the hostname from any given URL. So here is what I came up with. CREATE OR REPLACE FUNCTION getHostFromUrl(p_url character varying) RETURNS character varying AS $BODY$ declare begin return substring(p_url from 'http.?://(.*?)/(.*)'); end; $BODY$ LANGUAGE 'plpgsql' VOLATILE COST 100;]]></description>
			<content:encoded><![CDATA[<p>I just needed a simple stored procedure to extract the hostname from any given URL. So here is what I came up with.</p>
<pre class="prettyprint lang-sql">
CREATE OR REPLACE FUNCTION getHostFromUrl(p_url character varying)
  RETURNS character varying AS
$BODY$
declare
begin
  return substring(p_url from  'http.?://(.*?)/(.*)');
end;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.underdog-projects.net/2009/06/get-hostname-from-url-as-stored-procedure-in-plpgsql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

