<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Gahooa Perspective &#187; database backup</title>
	<atom:link href="http://blog.gahooa.com/tag/database-backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gahooa.com</link>
	<description>Thoughts on Life, Engineering, Technology, Business, and more...</description>
	<lastBuildDate>Sun, 11 Dec 2011 19:44:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.gahooa.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Gahooa Perspective &#187; database backup</title>
		<link>http://blog.gahooa.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.gahooa.com/osd.xml" title="The Gahooa Perspective" />
	<atom:link rel='hub' href='http://blog.gahooa.com/?pushpress=hub'/>
		<item>
		<title>PostgreSQL Dump and Restore Notes</title>
		<link>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/</link>
		<comments>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/#comments</comments>
		<pubDate>Mon, 17 May 2010 03:10:59 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[database backup]]></category>
		<category><![CDATA[pg_dump]]></category>
		<category><![CDATA[pg_restore]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=225</guid>
		<description><![CDATA[The pg_dump and pg_restore commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it. I&#8217;ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile &#8212; no stray relations left to cause trouble. Unless you own all of the objects being restored, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=225&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.postgresql.org/docs/8.4/static/app-pgdump.html">pg_dump</a> and <a href="http://www.postgresql.org/docs/8.4/static/app-pgrestore.html">pg_restore</a> commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it.</p>
<p>I&#8217;ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile &#8212; no stray relations left to cause trouble.</p>
<p>Unless you own all of the objects being restored, you may need to be SUPERUSER in order to have a successful restore.</p>
<p>The custom dump format is quite useful.  Unlike the normal sequence of SQL statements you may be used to from mysqldump (and pg_dump as well), the &#8211;format=custom option will create a compressed archive file (internally a tar file) that can be selectivly read with pg_restore.  That flexibility could come in handy if you *just* need the schema from 1 table, or *just* the data from another table.</p>
<p><strong>Dump:</strong><br />
pg_dump &#8211;format=custom -U jason_super MyDatabase &gt; MyDatabase.pgdump</p>
<p><strong>Restore</strong><br />
pg_restore &#8211;exit-on-error &#8211;clean &#8211;dbname=MyDatabase MyDatabase.pgdump</p>
<p><strong>Get all of the SQL</strong><br />
pg_restore TMTManage_2.pgdump | more</p>
<p><strong>Get some of the SQL</strong><br />
pg_restore &#8211;schema=ACRM &#8211;table=Admin TMTManage_2.pgdump | more</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/database-backup/'>database backup</a>, <a href='http://blog.gahooa.com/tag/pg_dump/'>pg_dump</a>, <a href='http://blog.gahooa.com/tag/pg_restore/'>pg_restore</a>, <a href='http://blog.gahooa.com/tag/postgresql/'>PostgreSQL</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=225&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
	</channel>
</rss>
