<?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>2ndQuadrant &#187; Craig&#8217;s PlanetPostgreSQL</title>
	<atom:link href="http://blog.2ndquadrant.com/craigs-planetpostgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.2ndquadrant.com</link>
	<description>PostgreSQL expertise from specialists with a source code level understanding of RDBMS</description>
	<lastBuildDate>Sun, 19 May 2013 09:09:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Help us make a better PostgreSQL 9.3!</title>
		<link>http://blog.2ndquadrant.com/help-us-make-a-better-postgresql-9-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=help-us-make-a-better-postgresql-9-3</link>
		<comments>http://blog.2ndquadrant.com/help-us-make-a-better-postgresql-9-3/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 09:02:34 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=555</guid>
		<description><![CDATA[As interest in PostgreSQL grows, so does the rate at which new patches are proposed. To maintain...]]></description>
			<content:encoded><![CDATA[<p>As interest in PostgreSQL grows, so does the rate at which new patches are proposed. To maintain the high level of quality in PostgreSQL it is important that all patches be checked and reviewed, so that what gets added to the codebase is good quality.</p>
<p>Some of this evaluation requires a lot of expertise in the PostgreSQL core code, but most of it requires little development experience at all. The more initial checking and review gets done before patches get evaluated by the experts, the less work those experts have to do. So: please step up and review a patch. There are <a href="https://wiki.postgresql.org/wiki/Reviewing_a_Patch">patch review guidelines on the wiki</a>, and it&#8217;s quite an accessible process. Step right up if you want to contribute a little back to the software you use and rely on, or if there&#8217;s a particular enhancement you want to make sure goes into 9.3.</p>
<p>If you don&#8217;t feel up to reviewing the feature you&#8217;re interested in, you can still help by testing and initially reviewing something else, so others have more time to examine the complicated stuff. You can still help out.</p>
<p>I&#8217;ll be posting a series on patches proposed for 9.3, starting with today&#8217;s patch, Peter Eisentraut&#8217;s addition of a <tt>ALTER ROLE</tt> extension to change PostgreSQL settings (like <tt>work_mem</tt>, <tt>search_path</tt>, etc) for all users on all databases. The <a href="http://www.postgresql.org/message-id/50F55F5A.3050207@gmx.net">initial post explaining the patch is here</a> and <a href="https://commitfest.postgresql.org/action/patch_view?id=1060">this is the commitfest entry</a>.</p>
<p>To get involved, <a href="https://commitfest.postgresql.org/action/commitfest_view?id=17">visit the current commitfest page</a>, sign in with your PostgreSQL community login, and have a look at the <a href="https://commitfest.postgresql.org/action/commitfest_view?id=17&amp;status=1">list of patches needing review</a>. If there&#8217;s one there that doesn&#8217;t have an existing reviewer listed, or that interests you, please get involved! Grab the patch, read the reviewer guidelines, and help make PostgreSQL better.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/help-us-make-a-better-postgresql-9-3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Cygwin users needed to test a patch for PostgreSQL 9.3</title>
		<link>http://blog.2ndquadrant.com/cygwin-users-needed-to-test-a-patch-for-postgresql-9-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cygwin-users-needed-to-test-a-patch-for-postgresql-9-3</link>
		<comments>http://blog.2ndquadrant.com/cygwin-users-needed-to-test-a-patch-for-postgresql-9-3/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 08:45:05 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=551</guid>
		<description><![CDATA[Cygwin users, If you use PostgreSQL on Cygwin, please try out this build fix, verifying that it...]]></description>
			<content:encoded><![CDATA[<p>Cygwin users,</p>
<p>If you use PostgreSQL on Cygwin, please try out <a href="https://commitfest.postgresql.org/action/patch_view?id=1033">this build fix</a>, verifying that it works on Cygwin, and that it doesn&#8217;t break the Linux/BSD builds or the MinGW Windows builds. Your help would be appreciated in ensuring that Cygwin remains a supported platform into the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/cygwin-users-needed-to-test-a-patch-for-postgresql-9-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testers needed for proposed 9.3 SEPostgreSQL enhancements</title>
		<link>http://blog.2ndquadrant.com/testers-needed-for-proposed-9-3-sepostgresql-enhancements/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testers-needed-for-proposed-9-3-sepostgresql-enhancements</link>
		<comments>http://blog.2ndquadrant.com/testers-needed-for-proposed-9-3-sepostgresql-enhancements/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 08:42:24 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=548</guid>
		<description><![CDATA[SELinux / SEPostgreSQL users: There are some proposed improvements in the 2013-01 commitfest that might go into...]]></description>
			<content:encoded><![CDATA[<p>SELinux / SEPostgreSQL users: There are some proposed improvements in the 2013-01 commitfest that might go into PostgreSQL 9.3 &#8211; but only if you help.</p>
<p>Interested users are needed to try out the following patches and report back with their experiences if you want to see these changes in 9.3:</p>
<p>The patches are:</p>
<p>Add a new event type of object_access_hook named OAT_POST_ALTER. This allows extensions to catch controls just after system catalogs are updated. Patch also adds sepgsql permission check capability on some ALTER commands, but not all.<br />
<a href="https://commitfest.postgresql.org/action/patch_view?id=1003"></p>
<p>https://commitfest.postgresql.org/action/patch_view?id=1003</a></p>
<p>This patch adds sepgsql support for permission checks equivalent<br />
to the existing SCHEMA USE privilege:<br />
<a href="https://commitfest.postgresql.org/action/patch_view?id=1065">https://commitfest.postgresql.org/action/patch_view?id=1065</a></p>
<p>This patch adds sepgsql support for permission checks almost<br />
equivalent to the existing FUNCTION EXECUTE privilege:<br />
<a href="https://commitfest.postgresql.org/action/patch_view?id=1066">https://commitfest.postgresql.org/action/patch_view?id=1066</a></p>
<p>This patch adds sepgsql the feature of name qualified creation label:<br />
<a href="https://commitfest.postgresql.org/action/patch_view?id=1064">https://commitfest.postgresql.org/action/patch_view?id=1064</a></p>
<p>If you&#8217;re interested in SELinux, please glance at the discussion linked to in those patch entries, then grab a patch and try it out as per the reviewer guidelines:</p>
<p><a href="http://wiki.postgresql.org/wiki/Reviewing_a_Patch"></p>
<p>http://wiki.postgresql.org/wiki/Reviewing_a_Patch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/testers-needed-for-proposed-9-3-sepostgresql-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL regression tests hanging on Windows? Check path depth.</title>
		<link>http://blog.2ndquadrant.com/postgresql-regression-tests-hanging-on-windows-check-path-depth/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=postgresql-regression-tests-hanging-on-windows-check-path-depth</link>
		<comments>http://blog.2ndquadrant.com/postgresql-regression-tests-hanging-on-windows-check-path-depth/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 05:56:33 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=541</guid>
		<description><![CDATA[I just confirmed the cause an extremely weird problem that&#8217;s been frustrating me for days. I want...]]></description>
			<content:encoded><![CDATA[<p>I just confirmed the cause an extremely weird problem that&#8217;s been frustrating me for days. I want to share it so nobody else has to waste their time on this.</p>
<p>It appears that &#8211; at least on my build machine, a Windows 7 SP1 x64 box with Windows SDK 7.1, Visual Studio 2010 Express SP1 and Visual Studio Express 2012 on it &#8211; <tt>vcregress check</tt> will hang indefinitely with a <tt>postgres.exe</tt> process sitting at 100% cpu <i>if the regression tests are run in a path that is too deep</i>. This seems to happen with both x64 and x86 builds.</p>
<p><tt>git.exe</tt> seems to have a similar problem, where a <tt>git clean -fdx</tt> in a deep directory tree will sit at 100% cpu forever, making no progress.</p>
<p>In both <tt>git.exe</tt>&#8216;s and <tt>postgres.exe's</tt> cases, Process Monitor shows a steam of <tt>QueryNameInformationFile</tt> events with result <tt>BUFFER OVERFLOW</tt>. <a href="http://forum.sysinternals.com/simple-question_topic22038.html"><tt>QueryNameInformationFile</tt> is the <tt>IRP_MJ_QUERY_INFORMATION</tt> operation of <tt>ZwQueryInformationFile</tt></a> as <a href="http://msdn.microsoft.com/en-us/library/ff545817.aspx">documented in MSDN here</a>. It&#8217;s a kernel-level operation.</p>
<p>I&#8217;m yet to determine the root cause of the issue. To work around the problem, build in a shallower directory tree.</p>
<p>I&#8217;ve included a bunch of details after the cut, primarily to help anyone else with this problem find this post. </p>
<p><span id="more-541"></span></p>
<hr />
<p>This works:</p>
<pre>
	cd C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\BT\release\SL_OS\windows\TA\x86\TO\2008\src\tools\msvc
	"perl" vcregress.pl check
============== creating temporary installation        ==============
============== initializing database system           ==============
============== starting postmaster                    ==============
running on port 57532 with PID 100
============== creating database "regression"         ==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries        ==============
test tablespace               ... ok
</pre>
<p>This, with the exact same code, fails, hanging indefinitely on <tt>test tablespace</tt>:</p>
<pre>
	cd C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\tools\msvc
	"perl" vcregress.pl check
============== creating temporary installation        ==============
============== initializing database system           ==============
============== starting postmaster                    ==============
running on port 57532 with PID 128
============== creating database "regression"         ==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries        ==============
test tablespace               ...
</pre>
<p>The <tt>postgres.exe</tt> backend the test is running on sits at 100% cpu (or rather, 50% because it&#8217;s 100% of one core on a dual core box). It cannot be terminated via Task Manager or Process Explorer &#8211; End Task appears to succeed without error, but doesn&#8217;t actually kill the process. Neither does <tt>taskkill.exe</tt> even with the <tt>/F</tt> flag. Only a reboot seems to get rid of it. Sometimes subsequent attempts to kill it fail with a &#8220;permission denied&#8221; error.</p>
<p>When they&#8217;re hung, a backtrace from Process Explorer shows, for a 32-bit Pg running on a 64-bit host:</p>
<pre>
ntoskrnl.exe!KeWaitForMultipleObjects+0xc0a
ntdll.dll!NtCreateFile+0xa
wow64.dll!Wow64EmulateAtlThunk+0xe697
wow64.dll!Wow64SystemServiceEx+0xd7
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x2d
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x429
ntdll.dll!RtlUniform+0x6e6
ntdll.dll!RtlCreateTagHeap+0xa7
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!NtCreateFile+0x12
kernel32.dll!CreateFileW+0x4a
kernel32.dll!CreateFileA+0x36
postgres.exe!pgwin32_open+0xbc
postgres.exe!BasicOpenFile+0x1e
postgres.exe!GetNewRelFileNode+0xfa
postgres.exe!heap_create_with_catalog+0x1df
postgres.exe!DefineRelation+0x44e
postgres.exe!standard_ProcessUtility+0x425
postgres.exe!PortalRunUtility+0xa2
postgres.exe!PortalRunMulti+0x11b
postgres.exe!PortalRun+0x176
postgres.exe!exec_simple_query+0x3d1
postgres.exe!PostgresMain+0x5b5
postgres.exe!BackendRun+0x179
postgres.exe!SubPostmasterMain+0x31d
postgres.exe!main+0x1f4
postgres.exe!__tmainCRTStartup+0x122
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36
</pre>
<p>In Process Monitor, you see a long stream of <tt>QueryNameInformationFile</tt> events:</p>
<pre>
Date &amp; Time:    16/01/2013 9:31:17 PM
Event Class:    File System
Operation:      QueryNameInformationFile
Result: BUFFER OVERFLOW
Path:   C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\data
TID:    4908
Duration:       0.0000015
Name:   \jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\da
</pre>
<p>with stack traces like this, again from a 32-bit Pg on a 64-bit host:</p>
<pre>
0              0xfffff88001420067      0xfffff88001420067
1              0xfffff88001421329      0xfffff88001421329
2              0xfffff8800141f6c7      0xfffff8800141f6c7
3              0xfffff80002589636      0xfffff80002589636
4              0xfffff800026b2bbe      0xfffff800026b2bbe
5              0xfffff800026b2f2f      0xfffff800026b2f2f
6              0xfffff800026b3947      0xfffff800026b3947
7              0xfffff800026b3a4b      0xfffff800026b3a4b
8              0xfffff800025fc3ef      0xfffff800025fc3ef
9              0xfffff800025d8162      0xfffff800025d8162
10             0xfffff800025d95f6      0xfffff800025d95f6
11             0xfffff800025daefc      0xfffff800025daefc
12             0xfffff800025e5b54      0xfffff800025e5b54
13             0xfffff800022e1253      0xfffff800022e1253
14      ntdll.dll       ZwCreateFile + 0xa      0x773c186a      C:\Windows\SYSTEM32\ntdll.dll
15      wow64.dll       whNtCreateFile + 0x10f  0x7388bff7      C:\Windows\SYSTEM32\wow64.dll
16      wow64.dll       Wow64SystemServiceEx + 0xd7     0x7387cf87      C:\Windows\SYSTEM32\wow64.dll
17      wow64cpu.dll    TurboDispatchJumpAddressEnd + 0x2d      0x73802776      C:\Windows\SYSTEM32\wow64cpu.dll
18      wow64.dll       RunCpuSimulation + 0xa  0x7387d07e      C:\Windows\SYSTEM32\wow64.dll
19      wow64.dll       Wow64LdrpInitialize + 0x429     0x7387c549      C:\Windows\SYSTEM32\wow64.dll
20      ntdll.dll       LdrpInitializeProcess + 0x17e4  0x773b4956      C:\Windows\SYSTEM32\ntdll.dll
21      ntdll.dll        ?? ::FNODOBFM::`string' + 0x29220      0x773b1a17      C:\Windows\SYSTEM32\ntdll.dll
22      ntdll.dll       LdrInitializeThunk + 0xe        0x7739c32e      C:\Windows\SYSTEM32\ntdll.dll
23      ntdll.dll       ZwCreateFile + 0x12     0x775700a6      C:\Windows\SysWOW64\ntdll.dll
24      KERNELBASE.dll  CreateFileW + 0x35e     0x7628c5ef      C:\Windows\syswow64\KERNELBASE.dll
25      kernel32.dll    CreateFileWImplementation + 0x69        0x76a83f86      C:\Windows\syswow64\kernel32.dll
26      kernel32.dll    CreateFileA + 0x37      0x76a853e4      C:\Windows\syswow64\kernel32.dll
27      postgres.exe    pgwin32_open + 0xbc, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp
\src\port\open.c(77)     0x13eba5c       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src
\test\regress\tmp_check\install\bin\postgres.exe
28      postgres.exe    BasicOpenFile + 0x1e, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\x
p\src\backend\storage\file\fd.c(560)     0x12eec6e       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_
TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
29      postgres.exe    GetNewRelFileNode + 0xfa, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_
os\xp\src\backend\catalog\catalog.c(578) 0x11a836a       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_
TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
30      postgres.exe    heap_create_with_catalog + 0x1df, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg
_target_os\xp\src\backend\catalog\heap.c(1073)   0x11adf8f       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH
\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
31      postgres.exe    DefineRelation + 0x44e, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\commands\tablecmds.c(636)        0x11fb98e       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
32      postgres.exe    standard_ProcessUtility + 0x425, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\tcop\utility.c(535)     0x130f425       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
33      postgres.exe    PortalRunUtility + 0xa2, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\tcop\pquery.c(1191)     0x130d022       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
34      postgres.exe    PortalRunMulti + 0x11b, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\tcop\pquery.c(1320)      0x130d16b       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
35      postgres.exe    PortalRun + 0x176, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\tcop\pquery.c(815)    0x130da06       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
36      postgres.exe    exec_simple_query + 0x3d1, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\tcop\postgres.c(1053) 0x130ba61       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
37      postgres.exe    PostgresMain + 0x5b5, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\tcop\postgres.c(3969)      0x130c345       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
38      postgres.exe    BackendRun + 0x179, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\postmaster\postmaster.c(3987)        0x12c9459       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
39      postgres.exe    SubPostmasterMain + 0x31d, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\postmaster\postmaster.c(4491) 0x12cd08d       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
40      postgres.exe    main + 0x1f4, c:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\pg_build_type\release\pg_host_os\windows\pg_target_arch\x86\pg_target_os\xp\src\backend\main\main.c(175)   0x123fc24       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
41      postgres.exe    __tmainCRTStartup + 0x122, f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c(554) 0x13f7366       C:\jenkins\workspace\2ndquadrant-postgresql-qa-windows\PG_BUILD_TYPE\release\PG_HOST_OS\windows\PG_TARGET_ARCH\x86\PG_TARGET_OS\xp\src\test\regress\tmp_check\install\bin\postgres.exe
42      kernel32.dll    BaseThreadInitThunk + 0xe       0x76a833aa      C:\Windows\syswow64\kernel32.dll
43      ntdll.dll       __RtlUserThreadStart + 0x70     0x77589ef2      C:\Windows\SysWOW64\ntdll.dll
44      ntdll.dll       _RtlUserThreadStart + 0x1b      0x77589ec5      C:\Windows\SysWOW64\ntdll.dll
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/postgresql-regression-tests-hanging-on-windows-check-path-depth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simplifying compilation of PostgreSQL on Windows</title>
		<link>http://blog.2ndquadrant.com/easier-postgresql-builds-for-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=easier-postgresql-builds-for-windows</link>
		<comments>http://blog.2ndquadrant.com/easier-postgresql-builds-for-windows/#comments</comments>
		<pubDate>Wed, 09 Jan 2013 03:48:36 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=529</guid>
		<description><![CDATA[As part of some internal continuous integration and testing work, I&#8217;ve put together some scripts to simplify...]]></description>
			<content:encoded><![CDATA[<p>As part of some internal continuous integration and testing work, I&#8217;ve put together some scripts to simplify the compilation of PostgreSQL on Windows.</p>
<p>PostgreSQL its self is pretty easy to compile on Windows. You download and install ActiveState Perl and Visual Studio or the Microsoft Windows SDK, unpack a PostgreSQL source tree, copy <tt>config_default.pl</tt> to <tt>src\tools\msvc\config.pl</tt>, edit it to reflect your environment, open an SDK command prompt for your Windows SDK version / Visual Studio version, cd to the PostgreSQL directory, and run <tt>src\tools\msvc\build.pl</tt>. Not too bad.</p>
<p>The trouble is getting the dependencies built, and that&#8217;s what I&#8217;m working on improving. The scripts I&#8217;ve published at <a href="https://github.com/2ndQuadrant/pg_build_win">http://github.com/2ndQuadrant/pg_build_win</a> are a step toward that. I&#8217;ve written some NMake files and a wrapper Perl script that will download dependencies, compile them, and create a <tt>config.pl</tt> that points the PostgreSQL build at them. It can build a source tree you&#8217;ve checked out yourself, or it can automatically handle checking your specified PostgreSQL version(s) out from git.</p>
<p>At present the scripts are known to work with the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=8442">Microsoft Windows SDK 7.1</a>, Microsoft&#8217;s free stand-alone SDK. They do <i>not</i> yet work with Visual Studio, but that should be along shortly.</p>
<p>Currently the tools document the unattended installation procedure for the required 3rd party tools and libraries (Perl, Python, TCL, Windows SDK, etc) and will download and compile zlib for you. I want to add support for more of PostgreSQL&#8217;s optional dependencies, automating their installation to prevent everyone from having to suffer through the &#8220;fun&#8221; of compiling open source libraries like gettext on Windows. It&#8217;s just a matter of having the time. The mismash of precompiled binaries recommended by the documentation for compiling on Windows won&#8217;t work for x64 builds and isn&#8217;t very safe anyway; ideally all the libraries should be compiled with the same compiler and linked to the same runtime.</p>
<p>These scripts are primarily intended to satisfy internal requirements for compiling a variety of PostgreSQL versions and configurations under a Jenkins CI server, but I&#8217;d value any use reports or feedback. </p>
<p>Oh: Why perl? Because the PostgreSQL build scripts are written in Perl, so it&#8217;s the obvious first choice. I would&#8217;ve preferred Python or Powershell, but this way there isn&#8217;t an additional dependency above what PostgreSQL its self requires. NMake alone doesn&#8217;t offer the text processing features I needed to (for example) extract the Windows SDK version from the output of <tt>cl.exe</tt>.</p>
<p>To try the scripts out, see the <a href="https://github.com/2ndQuadrant/pg_build_win/blob/master/README.md">the README</a> in the repository. I won&#8217;t repeat that documentation here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/easier-postgresql-builds-for-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>During installation, cluster initialisation fails with the message &#8220;No error&#8221; on Windows</title>
		<link>http://blog.2ndquadrant.com/postgresql-cluster-initialisation-failures-no-error-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=postgresql-cluster-initialisation-failures-no-error-windows</link>
		<comments>http://blog.2ndquadrant.com/postgresql-cluster-initialisation-failures-no-error-windows/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 05:53:26 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=480</guid>
		<description><![CDATA[Today I ran into another strange issue with PostgreSQL installation on Windows. It turned out not to...]]></description>
			<content:encoded><![CDATA[<p>Today I ran into another strange issue with PostgreSQL installation on Windows. It turned out not to be a problem with the installer; instead it was a form of broken Windows installation that I hadn&#8217;t seen before, so I thought I&#8217;d write it up.</p>
<p>The installer already contains checks for several kinds of broken Windows install. For example, it tests to make sure that <code>%TEMP%</code> is writeable, and to makes sure the vbscript interpreter actually works. These were both the cause of frequent problem reports to the mailing lists in the past.</p>
<p>This is a less common issue, though it&#8217;s clearly turned up in the wild before, as shown by <a href="http://postgresql.1045698.n5.nabble.com/initdb-failure-td2083455.html">this report</a> and <a href="http://forums.enterprisedb.com/posts/list/2125.page">this one</a>. It turns out that some &#8211; probably rare &#8211; Windows installs  have an incorrect <code>%COMSPEC%</code> environment variable. This causes <code>popen</code> to fail with the wonderfully useful error message: <code>"No error"</code> when <code>initdb</code> tries to execute the PostgreSQL backend.  The message displayed to the user is:</p>
<blockquote><p>
Problem running post-install step. Installation may not complete correctly. The database cluster initialisation failed.
</p></blockquote>
<p>&#8230; <a href="http://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows#Common_installation_errors">which can be caused by several different issues</a>, of which this is only one.</p>
<p><span id="more-480"></span></p>
<p>If this is your issue, when you <a href="http://wiki.postgresql.org/wiki/Troubleshooting_Installation#Collect_the_installer_log_file">examine the installer log file</a>, <code>%TEMP%\postgresql-installer.log</code>, you&#8217;ll find that it contains:</p>
<pre>
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\9.2/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files\PostgreSQL\9.2" "C:\Program Files\PostgreSQL\9.2\data" 5432 "DEFAULT"
Script exit code: 1
</pre>
<p>then a bit further down in the log you&#8217;ll see:</p>
<pre>
creating template1 database in C:/Program Files/PostgreSQL/9.2/data/base/1 ... initdb: could not execute command ""C:/Program Files/PostgreSQL/9.2/bin/postgres.exe" --boot -x1 -F ": No error
</pre>
<p>If so, <a href="http://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows#Check_the_.25COMSPEC.25_environment_variable">check to make sure your <code>ComSpec</code> environment variable is valid</a>. Open a command prompt and run:</p>
<pre>
"%COMSPEC%" /C "echo test ok"
</pre>
<p>If it prints &#8220;test ok&#8221; then it&#8217;s likely fine and the issue is probably something else. If it fails, you&#8217;ve found the problem. Either way, check the value with:</p>
<pre>
echo %COMSPEC%
</pre>
<p>It should print something like:</p>
<pre>
C:\Windows\system32\cmd.exe
</pre>
<p>where <code>C:\Windows</code> is the location of your Windows install as shown by <code>echo %WINDIR%</code> or <code>echo %SYSTEMROOT%</code>.</p>
<p>In the case of the issue I was investigating it was instead:</p>
<pre>
%SystemRoot%\system32\cmd.exe;
</pre>
<p>It&#8217;s valid, though not standard, to have <code>%SYSTEMROOT%</code> instead of <code>C:\Windows</code>, so that wasn&#8217;t the issue. The problem is the trailing semicolon (&#8216;;&#8217;). This single extra character was causing <code>initdb</code> to fail to launch <code>postgres.exe</code> during database cluster creation because the <code>popen(...)</code> call was failing. The <code>popen</code> call requires that <code>ComSpec</code> point to a valid shell.</p>
<p>The error was fixed by <a href="http://www.itechtalk.com/thread3595.html">correcting the <code>COMSPEC</code> environment variable</a>. We opened the <b>System</b> control panel, opened <b>Advanced system settings</b>, and in the <b>Environment Variables</b> section under <b>System variables</b> edited <code>ComSpec</code> to remove the trailing semicolon.</p>
<p>One character.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/postgresql-cluster-initialisation-failures-no-error-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving PostgreSQL performance on AWS EC2</title>
		<link>http://blog.2ndquadrant.com/postgresql_performance_on_ec2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=postgresql_performance_on_ec2</link>
		<comments>http://blog.2ndquadrant.com/postgresql_performance_on_ec2/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 02:00:34 +0000</pubDate>
		<dc:creator>craig.ringer</dc:creator>
				<category><![CDATA[Craig's PlanetPostgreSQL]]></category>
		<category><![CDATA[amazon ec2]]></category>
		<category><![CDATA[perform]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[postgresql performance]]></category>
		<category><![CDATA[virtual machine]]></category>

		<guid isPermaLink="false">http://blog.2ndquadrant.com/?p=453</guid>
		<description><![CDATA[Questions periodically come up on the PostgreSQL mailing list regarding Amazon EC2 and how to get PostgreSQL...]]></description>
			<content:encoded><![CDATA[<p>Questions periodically come up on the PostgreSQL mailing list regarding Amazon EC2 and how to get PostgreSQL to perform well on it. The general feeling on the list appears to have been that EC2 performs very poorly for database workloads, at least with PostgreSQL, and it doesn&#8217;t seem to be taken particularly seriously as a platform. I certainly thought of it as a last resort myself, for when other constraints prevent you from using a proper VPS or real hardware.</p>
<p>I had the chance to meet with a high level AWS support engineer last week. It&#8217;s prompted me to write up the basics of configuring EC2 instances for decent PostgreSQL performance. I haven&#8217;t had the chance to back the following advice with hard numbers and benchmarks yet, so remember: Always test everything with a simulation of your workload.</p>
<p>Before I can get into the configuration details, I need to outline how EC2 storage works.<br />
<!-- more --></p>
<h2>EC2 storage types</h2>
<p>EC2 instances have two very different storage options. These are explained quite well in the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/Storage.html">storage documentation</a>, so I won&#8217;t repeat the details. It&#8217;s sufficient to say that the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/InstanceStorage.html">Instance Store</a> is local to the VM and is unrecoverably lost if the VM is stopped. It is backed by local hard drive or SSD storage. <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AmazonEBS.html">EBS</a> by contrast is durable and isn&#8217;t lost when the VM is stopped. It is more like <a href="http://nbd.sourceforge.net/">NBD</a> or iSCSI than local storage; it&#8217;s a network block device protocol with the corresponding latency and throughput issues that entails.</p>
<p>If you&#8217;ve been facing performance issues, you might&#8217;ve seen the High I/O instance types and thought &#8220;That sounds ideal for my database workload&#8221;. I thought so myself &#8211; but they <em>won&#8217;t actually make any difference if your database storage is on EBS volumes</em>. The High I/O instances have fast <em>instance store</em> storage, but aren&#8217;t any different in terms of EBS. So if you&#8217;re been using a High I/O instance with a database that&#8217;s on EBS volumes you&#8217;re not gaining any benefit from the enhanced instance store I/O you&#8217;re paying for, and are better off on an EBS-optimized large instance.</p>
<h2>Durable databases</h2>
<p>For a durable database where you care about your data, what you want instead of a high I/O instance is an <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/instance-types.html#EBSOptimized">EBS Optimized instance</a>, which has guaranteed network bandwidth to the EBS storage servers. Use EBS volumes with <a href="http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/Scenarios.PIOPS.html">provisioned IOPs</a> and, for best results, stripe a group of EBS volumes into a RAID10 array. See <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/EBSPerformance.html">increasing EBS performance</a>.</p>
<p>You might also want to consider putting your <a href="http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-TEMP-TABLESPACES">temporary tablespaces</a> on the instance store, rather than EBS. That way things like on-disk sorts won&#8217;t compete with other data for EBS bandwidth, and will get to use probably-faster local storage. (See also <a href="http://www.postgresql.org/docs/current/static/manage-ag-tablespaces.html">tablespaces</a>).</p>
<p>As always, if you care about your data, back it up and use replication and/or PITR.</p>
<p>This is just the basics &#8211; there&#8217;s a lot more tuning, testing and performance work that can be done from here, not to mention work on HA, automated backup, and other data protection measures. Just using the right instance type will get you to vaguely reasonable performance; you won&#8217;t get the most out of your (virtual) iron without a lot more work.</p>
<h2>Non-durable instances</h2>
<p>If you have data you can re-generate, or you&#8217;re running streaming replicas from a master that you can just re-clone from the master, you don&#8217;t necessarily need durable storage.</p>
<p>In this case, consider using the instance store, which is available on every instance type except Micro.</p>
<p>Since you have <em>no hope of recovering the database if the instance terminates or stops anyway</em>, you might as well use <code>fsync=off</code> and <code>full_page_writes=off</code> in <code>postgresql.conf</code>, saving a lot of I/O and synchronization. This is one of the few situations where turning fsync off is acceptable; <em>never</em> do it for data you expect to preserve, as you&#8217;re effectively giving the database permission to corrupt your data if the power fails or the host OS crashes.</p>
<p>Since you&#8217;re using the instance store, you can also potentially benefit from one of the high I/O instance types, using an array of SSDs for extremely fast seeks and high IOPS.</p>
<p><em>Do not use the instance store for data you want to preserve!</em>. Use it only for analytics work on data sets you can re-generate, or for replicas of data where the master lives elsewhere.</p>
<p>A non-durable storage based setup needs extensive testing and is likely to need some different tuning and configuration to a normal PostgreSQL install. Don&#8217;t expect amazing performance out of the box, you&#8217;ll need to do more than just fire up a High I/O instance and set up a default Pg install on it.</p>
<h2>Future work</h2>
<p>The next step, time permitting, is to quantify the above information with hard numbers. How does a High I/O instance with the DB on instance store perform compared to an EBS optimized x.large with a RAID10 striped set of provisioned I/O EBS volumes? Or the ubiquitous micro instance?</p>
<p>I&#8217;d like to look at integrating S3 and Glacier support into <a href="http://www.pgbarman.org/">barman</a> and <a href="http://www.repmgr.org/">repmgr</a> down the track, as it&#8217;d be really interesting to have basebackups and WAL automatically stored in S3, archived to Glacier, used to provision new instance-store based replica servers, and more.</p>
<p>I&#8217;ll be doing more with EC2 in the coming months, so I expect to be able to offer more insight into future performance issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.2ndquadrant.com/postgresql_performance_on_ec2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
