<?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>david kerr &#187; php</title>
	<atom:link href="http://www.davidmkerr.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidmkerr.com</link>
	<description>Weapons designer. Innovator, inventor, world changer</description>
	<lastBuildDate>Thu, 20 May 2010 14:30:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Parsing large files with pgfouine in linux</title>
		<link>http://www.davidmkerr.com/databases/parsing-large-files-with-pgfouine-in-linux/</link>
		<comments>http://www.davidmkerr.com/databases/parsing-large-files-with-pgfouine-in-linux/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 00:01:45 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.davidmkerr.com/?p=206</guid>
		<description><![CDATA[pgfouine is a nice logfile analyzer for PostgreSQL written in php. I&#8217;m doing a trace on a very long running ETL process and the logfile generated is ~11GB. I&#8217;m running up against a 2GB barrier in php for fopen(). If you&#8217;ve got a 64bit machine and can recompile php with -D_FILE_OFFSET_BITS=64 then you&#8217;re good to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pgfouine.projects.postgresql.org/">pgfouine</a> is a nice logfile analyzer for PostgreSQL written in php.</p>
<p>I&#8217;m doing a trace on a very long running ETL process and the logfile generated is ~11GB.</p>
<p>I&#8217;m running up against a 2GB barrier in php for fopen(). If you&#8217;ve got a 64bit machine and can recompile php with -D_FILE_OFFSET_BITS=64 then you&#8217;re good to go. But in my case, I can&#8217;t do either.</p>
<p>The error i&#8217;d get is:</p>
<pre style="overflow-x:auto; overflow-y:hidden">
PHP Fatal error:  File  is not readable. in /var/lib/pgsql/pgfouine-1.1/include/GenericLogReader.class.php on line 85
</pre>
<p>So for Plan B I had to remember back to the days when 64 bit wasn&#8217;t even an option (back in my day, we had 8 bits and we liked &#8216;em!)</p>
<p>I used a named pipe since pgfouine expects a file and doesn&#8217;t seem to be able to read from stdin.</p>
<pre style="overflow-x:auto; overflow-y:hidden">
mknod /tmp/pg2 p
cat /var/log/postgres > /tmp/pg2 | ./pgfouine.php -file /tmp/pg2 > bla.html
</pre>
<p>Once that kicked off I stopped getting that error and pgfouine was able to process the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmkerr.com/databases/parsing-large-files-with-pgfouine-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
