<?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>pg_dump &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/pg_dump/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>Fri, 15 Dec 2017 19:59:21 +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: How to take Compressed Backup of Database?</title>
		<link>https://www.dbrnd.com/2017/12/postgresql-how-to-take-compressed-backup-of-database-pg_dump/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 22 Dec 2017 16:16:59 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[compressed backup]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[pg_dump]]></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 Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[zlib compression]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6871</guid>

					<description><![CDATA[In this post, I am sharing few options of pg_dump for taking the compressed backup in PostgreSQL. When your database size is increasing, you should demand compressed backup for saving the disk space and time both. Few OSs also not supported the big size of the single file so we have to split the backup [&#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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" 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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" 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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" 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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" 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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" 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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" 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%2F2017%2F12%2Fpostgresql-how-to-take-compressed-backup-of-database-pg_dump%2F&#038;title=PostgreSQL%3A%20How%20to%20take%20Compressed%20Backup%20of%20Database%3F" data-a2a-url="https://www.dbrnd.com/2017/12/postgresql-how-to-take-compressed-backup-of-database-pg_dump/" data-a2a-title="PostgreSQL: How to take Compressed Backup of Database?"></a></p><p>In this post, I am sharing few options of pg_dump for taking the compressed backup in PostgreSQL. </p>
<p>When your database size is increasing, you should demand compressed backup for saving the disk space and time both. </p>
<p>Few OSs also not supported the big size of the single file so we have to split the backup file into different files or we can go with compressed options. </p>
<blockquote><p>PostgreSQL supports zlib compression. We can use -Fc option in pg_dump for taking a compressed backup, and it also has an advantage like we can restore table selectively.</p></blockquote>
<p><strong>Syntax:</strong></p>
<pre class="crayon-plain-tag">pg_dump -Fc dbname &gt; filename</pre> </p>
<p><strong>Use pg_restore for restoring the database:</strong></p>
<pre class="crayon-plain-tag">pg_restore -d dbname filename</pre> </p>
<p><strong>We can also use gzip option for compression:</strong></p>
<pre class="crayon-plain-tag">pg_dump dbname | gzip &gt; filename.gz</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Take Schema backup or Copy Schema into another Server</title>
		<link>https://www.dbrnd.com/2017/07/postgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 31 Jul 2017 16:16:13 +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[pg_dump]]></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 Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[schema backup]]></category>
		<category><![CDATA[schema restore]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5725</guid>

					<description><![CDATA[Instead of a separate database, PostgreSQL DBAs are suggesting to create schemas in Postgres. The reason is cross database queries which is not supported in Postgres. In your database, you cannot select any data from another database of the same server. For that, you need to configure DB link which you can find in below [&#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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&amp;linkname=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" 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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&amp;linkname=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" 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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&amp;linkname=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" 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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&amp;linkname=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" 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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&amp;linkname=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" 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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&amp;linkname=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" 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%2F2017%2F07%2Fpostgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore%2F&#038;title=PostgreSQL%3A%20Take%20Schema%20backup%20or%20Copy%20Schema%20into%20another%20Server" data-a2a-url="https://www.dbrnd.com/2017/07/postgresql-take-schema-backup-or-copy-schema-into-another-server-pg_dump-restore/" data-a2a-title="PostgreSQL: Take Schema backup or Copy Schema into another Server"></a></p><p>Instead of a separate database, PostgreSQL DBAs are suggesting to create schemas in Postgres. The reason is cross database queries which is not supported in Postgres.</p>
<p>In your database, you cannot select any data from another database of the same server. For that, you need to configure DB link which you can find in below article.</p>
<blockquote data-secret="JB9UhdGzLo" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2015/05/postgresql-cross-database-queries-using/">PostgreSQL [Video]: Cross Database Queries using DbLink Extension</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/05/postgresql-cross-database-queries-using/embed/#?secret=JB9UhdGzLo" data-secret="JB9UhdGzLo" width="600" height="338" title="&#8220;PostgreSQL [Video]: Cross Database Queries using DbLink Extension&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>So, I have seen most of the PostgreSQL servers where user created lots of schema for a different purpose.<br />
Previously, I shared an article on how to take table backup in PostgreSQL. </p>
<blockquote data-secret="V7c86Ex9yG" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/">PostgreSQL: How to take a backup of your Table?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/embed/#?secret=V7c86Ex9yG" data-secret="V7c86Ex9yG" width="600" height="338" title="&#8220;PostgreSQL: How to take a backup of your Table?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>Recently, I got one request from a developer like they need one schema backup from Production Server to Development Server.<br />
In this post, I am sharing the script to take backup of your Schema and using the single command you can also copy your schema from one server to another server.<br />
Here, I am using pg_dump utility to perform this exercise. </p></blockquote>
<p><strong>Take only schema backup in .sql file:</strong></p>
<pre class="crayon-plain-tag">pg_dump --schema=schema_name db_name &gt; backupfile.sql</pre> </p>
<p><strong>Restore schema from backup .sql file:</strong></p>
<pre class="crayon-plain-tag">psql -d db_name -h localhost -U user_name &lt; backupfile.sql</pre> </p>
<p><strong>Copy or Restore schema backup into another PostgreSQL Server:</strong></p>
<pre class="crayon-plain-tag">pg_dump source_db_name --schema schema_name | psql -h destination_hostname -U distination_user_name -d distination_db_name</pre> </p>
<p><em>Note: While copying the schema from one server to another, please make sure that require owner or roles created on the destination server. </em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Use pg_dump &#124; SSH &#124; psql, Copy Table data from a Server to another Server</title>
		<link>https://www.dbrnd.com/2017/04/postgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server/</link>
					<comments>https://www.dbrnd.com/2017/04/postgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 24 Apr 2017 16:16:47 +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[Migrate table data]]></category>
		<category><![CDATA[pg_dump]]></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 Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[psql]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5065</guid>

					<description><![CDATA[The migration of data and tables between the server are a very common task for Database Administrator. In this post, I am sharing few options to migrate your data between servers such a way that you do not require to create any additional table backup file. Using pg_dump, SSH and PSQL, you can directly copy [&#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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" 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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" 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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" 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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" 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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" 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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" 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%2F2017%2F04%2Fpostgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server%2F&#038;title=PostgreSQL%3A%20Use%20pg_dump%20%7C%20SSH%20%7C%20psql%2C%20Copy%20Table%20data%20from%20a%20Server%20to%20another%20Server" data-a2a-url="https://www.dbrnd.com/2017/04/postgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server/" data-a2a-title="PostgreSQL: Use pg_dump | SSH | psql, Copy Table data from a Server to another Server"></a></p><p>The migration of data and tables between the server are a very common task for Database Administrator.</p>
<p>In this post, I am sharing few options to migrate your data between servers such a way that you do not require to create any additional table backup file.</p>
<p>Using pg_dump, SSH and PSQL, you can directly copy your table data from one server to another server.</p>
<blockquote><p>Recently, I had taken PostgreSQL DBA interview and asked question like &#8220;How to migrate table data from one server to another in PostgreSQL?&#8221;</p>
<p>A candidate said, create table backup file using pg_dump -&gt; copy that file in source server -&gt; use pg_restore to restore it.<br />
Don&#8217;t you think, so that above process is very long? Check the below few options, and you can migrate your data without any table backup file.</p></blockquote>
<p><strong>My Destination information:</strong></p>
<ul>
<li>Host: pgtest1.dbrnd.com</li>
<li>Table: public.tbl_stud</li>
<li>User: anvesh</li>
<li>Database: Students</li>
</ul>
<p><strong>My Source information:</strong></p>
<ul>
<li>Host: pgtest2.dbrnd.com</li>
<li>Table: public.tbl_stud</li>
<li>User: anvesh</li>
<li>Database: Students_test</li>
</ul>
<p><strong>Important Note:</strong></p>
<blockquote><p>Both the side table structure must be same like number columns and datatype of a column.</p></blockquote>
<p><strong>Option #1: Using SSH | PSQL</strong><br />
Use pg_dump with SSH | PSQL, and execute below command. It will ask password for pgtest2.dbrnd.com, and I set database password using variable PGPASSWORD. It will migrate only table data between server.</p><pre class="crayon-plain-tag">pg_dump --data-only --table=public.tbl_stud Students | ssh anvesh@pgtest2.dbrnd.com "PGPASSWORD=mypass psql -h pgtest2.dbrnd.com -U anvesh Students_test"</pre><p>
<strong>Option #2: Using only PSQL (Transfer data only)</strong><br />
Option -a is for data only.</p><pre class="crayon-plain-tag">pg_dump -t public.tbl_stud -a Students | psql -h pgtest2.dbrnd.com -p 5432 -d Students_test</pre><p>
<strong>Option #3: Using only PSQL (Transfer table structure with data)</strong></p><pre class="crayon-plain-tag">pg_dump -t public.tbl_stud Students | psql -h pgtest2.dbrnd.com -p 5432 -d Students_test</pre><p>
<strong>You can access below other related articles:</strong></p>
<ul>
<li><a href="https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/" target="_blank">Take a backup of your table:</a></li>
<li><a href="https://www.dbrnd.com/2017/02/postgresql-script-to-copy-schema-table-data-to-another-schema-table-migration/" target="_blank">Copy data between your schemas:</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/04/postgresql-use-pg_dump-ssh-psql-copy-table-data-from-a-server-to-another-server/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL: How to take a backup of your Table?</title>
		<link>https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/</link>
					<comments>https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 06 Feb 2017 16:16:39 +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[pg_dump]]></category>
		<category><![CDATA[pgAdmin]]></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 Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[table backup]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4478</guid>

					<description><![CDATA[Recently, I shared an article about copy your full database from one server to another server. PostgreSQL: Copy Database to another Server in Windows (pg_dump &#8211; backup &#038; restore) I found one question on PostgreSQL FB Group like &#8220;How to take a backup of a table in PostgreSQL.&#8221; You can do this exercise using pg_dump [&#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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" 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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" 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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" 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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" 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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" 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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&amp;linkname=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" 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%2F2017%2F02%2Fpostgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin%2F&#038;title=PostgreSQL%3A%20How%20to%20take%20a%20backup%20of%20your%20Table%3F" data-a2a-url="https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/" data-a2a-title="PostgreSQL: How to take a backup of your Table?"></a></p><p>Recently, I shared an article about copy your full database from one server to another server. </p>
<blockquote data-secret="loPtmSAzyw" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/11/postgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool/">PostgreSQL: Copy Database to another Server in Windows (pg_dump &#8211; backup &#038; restore)</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/11/postgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool/embed/#?secret=loPtmSAzyw" data-secret="loPtmSAzyw" width="600" height="338" title="&#8220;PostgreSQL: Copy Database to another Server in Windows (pg_dump &#8211; backup &#038; restore)&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>I found one question on PostgreSQL FB Group like &#8220;How to take a backup of a table in PostgreSQL.&#8221;</p>
<p>You can do this exercise using pg_dump utility and pgAdmin tool. </p>
<p><strong>Using pgAdmin tool:</strong><br />
Right-click on a table and select backup option. In Dump Option window, you can find an option like backup Only schema, backup Only Data. Enter your file name path, select backup mode as plain text and take the backup of your table. You can restore this table in any database. </p>
<p>U<strong>sing psql, pg_dump utility:</strong></p>
<pre class="crayon-plain-tag">\9.5\bin&gt;pg_dump -U User_name -d database_name -t public.my_table &gt; f:\my_table.sql
Password:****</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/02/postgresql-how-to-take-a-backup-of-your-table-pg_dump-pg_admin/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL: Copy Database to another Server in Windows (pg_dump &#8211; backup &#038; restore)</title>
		<link>https://www.dbrnd.com/2016/11/postgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool/</link>
					<comments>https://www.dbrnd.com/2016/11/postgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 24 Nov 2016 19:58:35 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PostgreSQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[copy database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[pg_dump]]></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[psql]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[server]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3907</guid>

					<description><![CDATA[In our organization, junior database developers are learning PostgreSQL, and they require a sample database from our Validation Database Server. In this scenario, Database Administrator takes PostgreSQL backup using pg_dump utility and restore that dump into the development environment. A pg_dump is a PostgreSQL utility which is used for PostgreSQL database backup and restore. Another [&#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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&amp;linkname=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" 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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&amp;linkname=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" 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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&amp;linkname=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" 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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&amp;linkname=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" 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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&amp;linkname=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" 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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&amp;linkname=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" 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%2F11%2Fpostgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool%2F&#038;title=PostgreSQL%3A%20Copy%20Database%20to%20another%20Server%20in%20Windows%20%28pg_dump%20%E2%80%93%20backup%20%26%20restore%29" data-a2a-url="https://www.dbrnd.com/2016/11/postgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool/" data-a2a-title="PostgreSQL: Copy Database to another Server in Windows (pg_dump – backup &amp; restore)"></a></p><p>In our organization, junior database developers are learning PostgreSQL, and they require a sample database from our Validation Database Server. </p>
<p>In this scenario, Database Administrator takes PostgreSQL backup using pg_dump utility and restore that dump into the development environment.</p>
<blockquote><p>A pg_dump is a PostgreSQL utility which is used for PostgreSQL database backup and restore. </p></blockquote>
<blockquote><p>Another option is, directly copy the database from one server to another server using pg_dump + psql. In this scenario, Database Administrator does not require any intermediate database backup file. </p></blockquote>
<p><em>Open your windows command prompt and go to \PostgreSQL\bin directory where you can execute and test below two different commands.<br />
</em></p>
<p><strong>Copy database from one server to another server (using, pg_dump | psql):</strong></p>
<pre class="crayon-plain-tag">pg_dump -h host1 dbname | psql -h host2 dbname</pre> </p>
<p><strong>Copy database, Using pg_dump utility for backup and restore:</strong></p>
<p><strong>Take full database backup:</strong></p>
<pre class="crayon-plain-tag">pg_dump -U username database_name &gt; filepath\backup.sql</pre> </p>
<p><strong>Restore database backup:</strong></p>
<pre class="crayon-plain-tag">pg_dump -U username database_name &lt; filepath\backup.sql</pre> </p>
<blockquote data-secret="89S6qFpLwG" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/09/postgresql-file-system-level-backup-to-just-copy-data-directory-fast-postgres-cluster-backup-restore/">PostgreSQL: File System Level Backup to just Copy DATA Directory</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/09/postgresql-file-system-level-backup-to-just-copy-data-directory-fast-postgres-cluster-backup-restore/embed/#?secret=89S6qFpLwG" data-secret="89S6qFpLwG" width="600" height="338" title="&#8220;PostgreSQL: File System Level Backup to just Copy DATA Directory&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/11/postgresql-copy-database-from-one-server-to-another-server-in-windows-pg_dump-utility-backup-restore-psql-tool/feed/</wfw:commentRss>
			<slash:comments>25</slash:comments>
		
		
			</item>
	</channel>
</rss>
