<?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>Blog - PonticStar.com &#187; PostgreSQL</title>
	<atom:link href="http://www.ponticstar.com/blog/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ponticstar.com/blog</link>
	<description>Blog about various aspects of programming and web design</description>
	<lastBuildDate>Mon, 28 Jun 2010 19:53:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PostgreSQL crashes when using pgcrypto functions</title>
		<link>http://www.ponticstar.com/blog/2009/10/22/postgresql-crashes-when-using-pgcrypto/</link>
		<comments>http://www.ponticstar.com/blog/2009/10/22/postgresql-crashes-when-using-pgcrypto/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 02:44:18 +0000</pubDate>
		<dc:creator>Michael Ryvkin</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.ponticstar.com/blog/?p=103</guid>
		<description><![CDATA[After upgrading PostgreSQL from 7.4 to 8.2 it started crashing sporadically with the following entries in the log file:

<pre>LOG:  server process (pid 21460) was terminated by signal 11
LOG:  terminating any other active server processes
LOG:  all server processes terminated; reinitializing shared memory and semaphores</pre>]]></description>
			<content:encoded><![CDATA[<h3>PROBLEM:</h3>
<p>After upgrading PostgreSQL from 7.4 to 8.2 it started crashing sporadically with the following entries in the log file:</p>
<pre>LOG:  server process (pid 21460) was terminated by signal 11
LOG:  terminating any other active server processes
LOG:  all server processes terminated; reinitializing shared memory and semaphores</pre>
<h3>CAUSE:</h3>
<p>There were changes between PostgreSQL releases in functions definition used by pgcrypto module.</p>
<p>According to <a class="target-blank" href="http://marc.info/?l=postgresql-general&#038;m=118794006505296&#038;w=2">[1]</a> and <a class="target-blank" href="http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/pgcrypto/pgcrypto.sql.in">[3]</a> in PostgreSQL 8.0 the pgcrypto functions were non-strict and checked for <code>NULL</code>s, in PostgreSQL 8.1 they were made <code>STRICT</code>, in PostgreSQL 8.2 the <code>NULL</code> checks were removed from code.</p>
<h3>SOLUTION:</h3>
<p>In order to correct the problem these functions are needed to be recreated. Required SQL commands are defined in pgcrypto.sql which is usually located in<br />
<code>/usr/local/pgsql/share/contrib</code> when pgcrypto is installed.</p>
<pre>psql -d DBNAME -f /usr/local/pgsql/share/contrib/pgcrypto.sql</pre>
<p>Also it is a good idea to add functions to <code>template1</code> database if you use pgcrypto often. <code>template1</code> is the default source database name when using <code>CREATE DATABASE</code> command.</p>
<h3>REFERENCES:</h3>
<ol>
<li><a class="target-blank" href="http://marc.info/?l=postgresql-general&#038;m=118794006505296&#038;w=2">http://marc.info/?l=postgresql-general&#038;m=118794006505296&#038;w=2</a></li>
<li><a class="target-blank" href="http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg109917.html">http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg109917.html</a></li>
<li><a class="target-blank" href="http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/pgcrypto/pgcrypto.sql.in">http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/pgcrypto/pgcrypto.sql.in</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ponticstar.com/blog/2009/10/22/postgresql-crashes-when-using-pgcrypto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
