We are upgrading from 
<span style="color:rgb(80,0,80);font-size:13px;font-family:arial,sans-serif">2.1.3</span>  to the latest build.<div><br></div><div>Output of that query came up with dozens of rows with 2's in the second columns .</div>
<div class="yj6qo ajU"><div id=":15l" class="ajR" tabindex="0"><img class="ajT" src="https://mail.google.com/mail/images/cleardot.gif"></div></div><br><br><div class="gmail_quote">On Tue, Sep 18, 2012 at 4:50 PM, Jeff Finucane <span dir="ltr"><<a href="mailto:jeff@cmh.net" target="_blank">jeff@cmh.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Sep 18, 2012 at 04:35:32PM -0600, Ryan Ghering <<a href="mailto:rghering@gmail.com">rghering@gmail.com</a>> wrote:<br>

+----------<br>
<div class="im">| On upgrading to latest from 2.1.3 we are getting<br>
|<br>
| Upgrading cust_pkg...<br>
| DBD::Pg::st execute failed: ERROR:  more than one row returned by a<br>
| subquery used as an expression [for Statement "update cust_pkg set<br>
| order_date = (select history_date from h_cust_pkg<br>
|         where h_cust_pkg.pkgnum = cust_pkg.pkgnum and<br>
|         history_action = 'insert') where order_date is null"] at<br>
| /usr/local/share/perl/5.10.1/FS/<a href="http://cust_pkg.pm" target="_blank">cust_pkg.pm</a> line 3685.<br>
| ERROR:  more than one row returned by a subquery used as an expression at<br>
| /usr/local/share/perl/5.10.1/FS/<a href="http://cust_pkg.pm" target="_blank">cust_pkg.pm</a> line 3685.<br>
|<br>
| Our system is completely defunct at the moment, can't process payments, can<br>
| add services nada...<br>
|<br>
| Does anyone have an answer for this error??<br>
</div>+----------<br>
<br>
>From what version are you upgrading?<br>
<br>
It is curious that you have packages that have been inserted more than<br>
once.  Perhaps the best approach is to first determine the severity of<br>
the problem with something like<br>
<br>
select pkgnum, count(*) as number from h_cust_pkg where history_action='insert' group by pkgnum having count(*) > 1;<br>
<br>
If the number of rows is small (1?) perhaps removing offending<br>
h_cust_pkg rows is appropriate.  Alternatively one could set the<br>
order_date column in the corresponding cust_pkg row.  Perhaps prior<br>
intervention of this sort caused the problem.<br>
<br>
--<br>
<a href="mailto:jeff@cmh.net">jeff@cmh.net</a><br>
<br>
"There is no worse tyranny than to force a man to pay for what he does<br>
 not want merely because you think it would be good for him."<br>
<br>
 Professor Bernardo de le Paz<br>
  [ R.A. Heinlein -- "The Moon is a Harsh Mistress" ]<br>
<br>
_______________________________________________<br>
freeside-users mailing list<br>
<a href="mailto:freeside-users@freeside.biz">freeside-users@freeside.biz</a><br>
<a href="http://freeside.biz/cgi-bin/mailman/listinfo/freeside-users" target="_blank">http://freeside.biz/cgi-bin/mailman/listinfo/freeside-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Ryan Ghering<br>Network Operations - Plains.Net<br>Office: 970-848-0475 - Cell: 970-630-1879<br>