<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hey, All<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m working on upgrading my (currently 2.1.1 in production) Evergreen server up to the latest version 2.3.5, as of this morning when I started. I’m having a bit of trouble with one of the version-upgrade scripts (Open-ILS/src/sql/Pg/version-upgrade/2.2.0-2.2.1-upgrade-db.sql).
 All the previous scripts worked (2.1.1-2.1.2, 2.1.2-2.1.3, 2.1-2.2) without anything of concern. When I try to run this script, I get the following output:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">postgres@evergreen-test:~/scripts/version-upgrade$<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">postgres@evergreen-test:~/scripts/version-upgrade$ psql -U evergreen -h localhost -f ./2.2.0-2.2.1-upgrade-db.sql old_evergreen<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">Password for user evergreen:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">BEGIN<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">INSERT 0 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:10: ERROR:  duplicate key value violates unique constraint "upgrade_log_pkey"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">DETAIL:  Key (version)=(0722) already exists.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">CONTEXT:  SQL statement "INSERT INTO config.upgrade_log (version, applied_to) VALUES (my_db_patch, my_applied_to)"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">PL/pgSQL function "upgrade_deps_block_check" line 17 at SQL statement<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:13: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:20: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:58: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:61: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:161: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:164: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:264: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:267: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">psql:./2.2.0-2.2.1-upgrade-db.sql:365: ERROR:  current transaction is aborted, commands ignored until end of transaction block<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">ROLLBACK<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">postgres@evergreen-test:~/scripts/version-upgrade$<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I looked into it, and sure enough 0722 already does exist in config.upgrade_log. It is not the most recent entry in that table, and it was “applied_to” NULL. As I’m looking through the rest of the script, It looks as though upgrade operations
 0725 and 0726 would likely throw the same error.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What can I do to resolve the trouble with this particular script? My intention is to run through every one of the version-upgrade scripts between 2.1.1 and 2.3.5 (2.3.6 afterwards, as well), is that not the correct way to go about it?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Elliot J. Voris<o:p></o:p></p>
<p class="MsoNormal">IT Director<o:p></o:p></p>
<p class="MsoNormal">St. Louis Christian College<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="mailto:evoris@slcconline.edu">evoris@slcconline.edu</a><o:p></o:p></p>
<p class="MsoNormal"><a href="mailto:elliot@voris.me">elliot@voris.me</a><o:p></o:p></p>
<p class="MsoNormal">314.837.6777 x1250<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>