<?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>Server Side Guy &#187; PSQL</title>
	<atom:link href="http://serversideguy.com/category/psql/feed/" rel="self" type="application/rss+xml" />
	<link>http://serversideguy.com</link>
	<description>Just another Barsness Solutions weblog</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:57:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How To Duplicate a PGSQL database</title>
		<link>http://serversideguy.com/2009/08/10/how-to-duplicate-a-pgsql-database/</link>
		<comments>http://serversideguy.com/2009/08/10/how-to-duplicate-a-pgsql-database/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 12:41:50 +0000</pubDate>
		<dc:creator>Tim Barsness</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://serversideguy.com/?p=80</guid>
		<description><![CDATA[Recently I needed to create a duplicate of PGSQL database.  Being a MySQL guy, I didn&#8217;t know off hand how to do it, but here is an easy way: pg_dump original_db &#62; original_db.sql createdb new_db psql -d new_db &#60; original_db.sql From a bird&#8217;s eye view, you are creating a dump of the original database and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to create a duplicate of PGSQL database.  Being a MySQL guy, I didn&#8217;t know off hand how to do it, but here is an easy way:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">pg_dump original_db <span style="color: #339933;">&gt;</span> original_db<span style="color: #339933;">.</span>sql
createdb new_db
psql <span style="color: #339933;">-</span>d new_db <span style="color: #339933;">&lt;</span> original_db<span style="color: #339933;">.</span>sql</pre></div></div>

<p>From a bird&#8217;s eye view, you are creating a dump of the original database and outputting it to a file.  From there, make sure the new database is created and use your dump file as input for that database.  It wouldn&#8217;t be too hard to make this into a one-liner, but I like to see intermediate steps to make sure things are going well.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversideguy.com/2009/08/10/how-to-duplicate-a-pgsql-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

