<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Postgres on Evan Hoffman</title><link>https://evan.wtf/tags/postgres/</link><description>Recent content in Postgres on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Wed, 12 Feb 2014 11:06:07 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/postgres/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting user Postgres passwords via MD5</title><link>https://evan.wtf/2014/02/12/setting-user-postgres-passwords-via-md5/</link><pubDate>Wed, 12 Feb 2014 11:06:07 +0000</pubDate><guid>https://evan.wtf/2014/02/12/setting-user-postgres-passwords-via-md5/</guid><description>&lt;p&gt;Say you want to create a Postgres account for a user but you don&amp;rsquo;t want them to have to reset it after logging in, and you don&amp;rsquo;t want to do the &amp;ldquo;come type in a password on my computer&amp;rdquo; routine. Well, here&amp;rsquo;s one way around this.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Have the user generate an MD5 of their password on their local computer. Postgres uses the username as the salt for the hash, so the command to generate the md5 on a Mac would be (assuming a username of &amp;rsquo;ehoffman&amp;rsquo; and a password of &amp;lsquo;abcdefg&amp;rsquo;):&lt;/p&gt;</description></item><item><title>Goodbye, pg_dump</title><link>https://evan.wtf/2013/09/26/goodbye-pg_dump/</link><pubDate>Thu, 26 Sep 2013 09:12:05 +0000</pubDate><guid>https://evan.wtf/2013/09/26/goodbye-pg_dump/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a Postgres user and administrator for a while. Over the years, my views on backups have evolved.&lt;/p&gt;&#10;&lt;p&gt;Originally, like most people, I started out with good old pg_dump. With a reasonably small database (under 50 GB) dumping to a flat text file is a fine option. I&amp;rsquo;d generally do something like &lt;code&gt;pg_dump -Upostgres dbname | gzip &amp;gt; dbname.sql.gz&lt;/code&gt; to compress it on the fly and save space. For years this seemed perfect: dumping the entire database in a single transaction into a single file that can be restored anywhere.&lt;/p&gt;</description></item><item><title>Problems with PostgreSQL 9.0 on CentOS 6.3 with a 2.6.32-series kernel</title><link>https://evan.wtf/2012/09/25/problems-with-postgresql-9-0-on-centos-6-3-with-a-2-6-32-series-kernel/</link><pubDate>Tue, 25 Sep 2012 13:20:36 +0000</pubDate><guid>https://evan.wtf/2012/09/25/problems-with-postgresql-9-0-on-centos-6-3-with-a-2-6-32-series-kernel/</guid><description>&lt;p&gt;&lt;em&gt;Note: this is cross-posted from the &lt;a href="http://www.yodletechblog.com/post/problems-with-postgresql-9.0-on-centos-6.3-with-a-2.6.32-series-kernel/"&gt;Yodle Tech Blog&lt;/a&gt;&lt;/em&gt;.&#10;We recently migrated our Postgres database to a significantly more powerful machine. While our existing server was doing okay load-wise, we were approaching 90% full on its Postgres volume. We&amp;rsquo;d also recently acquired an awesome new PureStorage SSD-based SAN and were excited to move our database onto it. For comparison, here are the the specs for the two systems:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Old server&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;New server&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Nickname&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;DB1&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;DB2&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CPU&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2x 6-core &lt;a href="http://ark.intel.com/products/52576/Intel-Xeon-Processor-X5690-%2812M-Cache-3_46-GHz-6_40-GTs-Intel-QPI%29"&gt;Xeon X5690&lt;/a&gt; CPUs at 3.47GHz&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2x 8-core &lt;a href="http://ark.intel.com/products/64596/Intel-Xeon-Processor-E5-2690-%2820M-Cache-2_90-GHz-8_00-GTs-Intel-QPI%29"&gt;E5-2690&lt;/a&gt; CPUs at 2.90 GHz&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Memory&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;96 GB 1333 MHz&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;128 GB 1600 MHz&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Storage&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;- Dell PERC H800 SAS HBA - Dell MD1220 drive enclosure - 24x 15k RPM SAS drives configured in RAID 10&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;- QLogic QLE2562 dual-port 8 Gbit FC HBA - PureStorage SSD-based SAN&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;OS&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CentOS 5.6 x86_64&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CentOS 6.3 x86_64&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Kernel&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2.6.18-238.9.1.el5&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2.6.32-279.2.1.el6.x86_64&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;As you can probably guess, moving from spinning disk onto SSD was the centerpiece of the upgrade. We&amp;rsquo;d tested the PureStorage system pretty extensively and used it in some secondary databases and seen some amazing improvements. We were excited to see how it would handle our production workload.&lt;/p&gt;</description></item><item><title>Using WAL archiving &amp; Compellent snapshots for PostgreSQL backups</title><link>https://evan.wtf/2011/07/13/using-wal-archiving-compellent-snapshots-for-postgresql-backups/</link><pubDate>Wed, 13 Jul 2011 13:46:40 +0000</pubDate><guid>https://evan.wtf/2011/07/13/using-wal-archiving-compellent-snapshots-for-postgresql-backups/</guid><description>Changing my Postgres DB backup strategy from nightly &lt;code&gt;pg_dump&lt;/code&gt;s to WAL archiving with SAN snapshots.</description></item><item><title>Migrating a PostgreSQL DB to a new machine without doing a dump &amp; restore</title><link>https://evan.wtf/2011/07/11/migrating-a-postgresql-db-to-a-new-machine-without-doing-a-dump-restore/</link><pubDate>Mon, 11 Jul 2011 14:39:16 +0000</pubDate><guid>https://evan.wtf/2011/07/11/migrating-a-postgresql-db-to-a-new-machine-without-doing-a-dump-restore/</guid><description>rsync over NFS can be so fast.</description></item></channel></rss>