<?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>tech notes &#187; postgresql</title>
	<atom:link href="http://bsd.dischaos.com/category/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://bsd.dischaos.com</link>
	<description>just some random notes on BSDs, linux and web development</description>
	<lastBuildDate>Fri, 07 May 2010 10:18:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fixing corrupted Ironport Queue</title>
		<link>http://bsd.dischaos.com/2010/01/05/fixing-corrupted-ironport-queue/</link>
		<comments>http://bsd.dischaos.com/2010/01/05/fixing-corrupted-ironport-queue/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 16:35:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bsd]]></category>
		<category><![CDATA[other]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=160</guid>
		<description><![CDATA[Looks like there&#8217;s a hidden command you can use to fix queue problems similar to these:

Critical: Queue: Your queue has been corrupted; UNABLE TO REPAIR: unable to
mount queue: &#8216;(\&#8217;qstore/gcq.py get_time_sorted_gens&#124;919\&#8217;, &#8220;&#8220;, &#8220;[Errno 2] No such file or directory:
        \&#8217;/var/db/godspeed/gen/gen063.chk\&#8217;&#8221;, \&#8217;[qstore/gcq.py mount&#124;1387]
        [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like there&#8217;s a hidden command you can use to fix queue problems similar to these:</p>
<blockquote><p>
Critical: Queue: Your queue has been corrupted; UNABLE TO REPAIR: unable to<br />
mount queue: &#8216;(\&#8217;qstore/gcq.py get_time_sorted_gens|919\&#8217;, &#8220;<type<br />
        \'exceptions.OSError\'>&#8220;, &#8220;[Errno 2] No such file or directory:<br />
        \&#8217;/var/db/godspeed/gen/gen063.chk\&#8217;&#8221;, \&#8217;[qstore/gcq.py mount|1387]<br />
        [qstore/gcq.py load|996] [qstore/gcq.py get_time_sorted_gens|919]\&#8217;)&#8217;
</p></blockquote>
<blockquote><p>Critical: Error while sending alert: Unable to send System/Critical alert to xxx@xxx.com with subject &#8220;Critical <System> ironport: Queue: Your queue has been corrupted; UNABLE TO REPAIR: unab&#8230;&#8221;.
</p></blockquote>
<p>What it means is basically that the workqueue is corrupted and the ironport is unable to accept/deliver emails. Rebooting doesn&#8217;t help (doesn&#8217;t really change anything). There&#8217;s however a way of recovering your ironport from this problem. The hidden command is:</p>
<div class="codesnip-container" >resetqueue</div>
<p>It deletes the broken queue, creates a new one, removes all messages in the system quarantines and reboots the ironport. After this clean up operation your ironport should be as new.</p>
<p>What&#8217;s interesting is that by looking at various error messages thrown by Ironports from time to time (especially when something breaks more seriously &#8211; doesn&#8217;t happen too often Ironports are quite solid) you can actually see what&#8217;s running under the hood. Other than it running on something derived from FreeBSD (can&#8217;t be that far off it as they actually contribute some code back to the OS) it looks like it&#8217;s mostly run by python scripts. That&#8217;s interesting from the performance perspective as even the queue management seems to be written in python. Also the database used internally seems to be some version of PostgreSQL. A very nice choice of software&#8230;</p>
<p>Haven&#8217;t seen anything yet that would suggest what MTA (if it&#8217;s not something created by Ironport) is used there. Sure the fact it can write qmail compatible log files doesn&#8217;t mean anything <img src='http://bsd.dischaos.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2010/01/05/fixing-corrupted-ironport-queue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>auto_increment columns in PostgreSQL</title>
		<link>http://bsd.dischaos.com/2008/10/23/auto_increment-columns-in-postgresql/</link>
		<comments>http://bsd.dischaos.com/2008/10/23/auto_increment-columns-in-postgresql/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 20:59:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[postgresql]]></category>
		<category><![CDATA[auto_increment]]></category>

		<guid isPermaLink="false">http://bsd.dischaos.com/?p=47</guid>
		<description><![CDATA[nothing new or special but certainly worth joting down   What&#8217;s done in MySQL with auto_increment statement in PosgteSQL is a bit more complicated. It requires creating a sequence first:
CREATE SEQUENCE exp_seq;
and then using it in table definition:
CREATE TABLE exp (id INT NOT NULL PRIMARY KEY DEFAULT nextval(&#8216;exp_seq&#8217;), other varchar(30), created_at date);
Sequences are actually [...]]]></description>
			<content:encoded><![CDATA[<p>nothing new or special but certainly worth joting down <img src='http://bsd.dischaos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  What&#8217;s done in MySQL with auto_increment statement in PosgteSQL is a bit more complicated. It requires creating a sequence first:</p>
<blockquote><p>CREATE SEQUENCE exp_seq;</p></blockquote>
<p>and then using it in table definition:</p>
<blockquote><p>CREATE TABLE exp (id INT NOT NULL PRIMARY KEY DEFAULT nextval(&#8216;exp_seq&#8217;), other varchar(30), created_at date);</p></blockquote>
<p>Sequences are actually more powerfull than MySQL&#8217;s auto_increment as they have some interesting options. One of them is INCREMENT BY which can be very useful with some multiple master replication or multiple servers scenarios.</p>
<p>Operations allowed on sequences are: nextval, currval and setval.</p>
]]></content:encoded>
			<wfw:commentRss>http://bsd.dischaos.com/2008/10/23/auto_increment-columns-in-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
