<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Package: postgresql<o:p></o:p></p><p class=MsoNormal>Version: 9.4~beta3-3<o:p></o:p></p><p class=MsoNormal>Severity: critical<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The provided upgrade instructions, if run exactly, lead to data loss (critical).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When following the provided instructions, the current working directory is not changed.<o:p></o:p></p><p class=MsoNormal>Files are saved to the current working directory.<o:p></o:p></p><p class=MsoNormal>It is /extremely/ likely that the postgres user does not have write access to said current working directory (often it is /root ).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The instructions should be modified to store and read files in ~ postgres/ OR include a cd ~postgres (to ensure that the correct directory is referenced).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Alternatively, a multi-instruction pre/post commands with && separating operations should be used, to force an error to occur the first time revealing the need to modify the provided commands to administrator taste.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The provided example is particularly dangerous because it /looks/ at a glance like it will work and that status messages might be ignorable (during the work of copy/pasting or retyping lines).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Current, wrong, upgrade instructions.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The on-disk format of the PostgreSQL 9.4 data files has changed between<o:p></o:p></p><p class=MsoNormal>beta2 and beta3 (and as a consequence, the catalog version number). For that<o:p></o:p></p><p class=MsoNormal>reason, existing PostgreSQL 9.4 clusters need to be dumped using the old<o:p></o:p></p><p class=MsoNormal>package version, and reloaded after upgrading the packages.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The postgresql-9.4 package will now refuse to upgrade because version 9.4<o:p></o:p></p><p class=MsoNormal>clusters exist on the system.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Per default, a "main" cluster is created. Run "pg_lsclusters" to check if<o:p></o:p></p><p class=MsoNormal>other clusters exists, and repeat the steps below appropriately.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>To resolve the situation, before upgrading, execute:<o:p></o:p></p><p class=MsoNormal># su - postgres<o:p></o:p></p><p class=MsoNormal>$ pg_lsclusters<o:p></o:p></p><p class=MsoNormal>$ pg_ctlcluster 9.4 main start<o:p></o:p></p><p class=MsoNormal>$ pg_dumpall --cluster 9.4/main | gzip > 9.4-main.dump.gz<o:p></o:p></p><p class=MsoNormal>$ cp -a /etc/postgresql/9.4/main 9.4-main.config<o:p></o:p></p><p class=MsoNormal>$ pg_dropcluster 9.4 main --stop<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Then after the upgrade, execute:<o:p></o:p></p><p class=MsoNormal># su - postgres<o:p></o:p></p><p class=MsoNormal>$ pg_createcluster 9.4 main<o:p></o:p></p><p class=MsoNormal>$ cp 9.4-main.config/* /etc/postgresql/9.4/main<o:p></o:p></p><p class=MsoNormal>$ pg_ctlcluster 9.4 main start<o:p></o:p></p><p class=MsoNormal>$ zcat 9.4-main.dump.gz | psql -q<o:p></o:p></p><p class=MsoNormal>$ rm -rf 9.4-main.config 9.4-main.dump.gz<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>