[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error when adding customer's email addy: relation "vc" does not exist



On Wed, Feb 4, 2009 at 6:17 AM, Stroller <..hidden..> wrote:
> Amending an existing customer's details to add their email address
> today, I got the following error when pressing the save button:
>
>     DBD::Pg::st execute failed: ERROR: relation "vc" does not exist
>     Error!
>
>     SELECT a.id, a.invnumber, a.ordnumber, a.transdate,
>     a.duedate, a.netamount, a.amount, (a.paid) AS paid,
>     a.invoice, a.datepaid, a.terms, a.notes,
>     a.shipvia, a.shippingpoint, e.name AS employee,
>     vc.name,
>     a._id, a.till, m.name AS manager, a.curr,
>     ex.buy AS exchangerate,
>     d.description AS department,
>     a.ponumber
>     FROM ar a
>     JOIN vc ON (a._id = vc.id)
>     LEFT JOIN employee e ON (a.employee_id = e.id)
>     LEFT JOIN employee m ON (e.managerid = m.id)
>     LEFT JOIN exchangerate ex ON (ex.curr = a.curr
>                    AND ex.transdate = a.transdate)
>     LEFT JOIN department d ON (a.department_id = d.id)
>     WHERE 1 = 1 AND a.transdate >= '1/12/8'
>     ORDER BY 4 ASC,2,16
>     ERROR: relation "vc" does not exist
>
> I am using the venerable version 1.2.8 of LedgerSMB, but I'm inclined
> to think I may have missed running a database upgrade script during an
> earlier update. The email address has been correctly saved to the
> account's details if I search for that customer once again.
>
> Any thoughts?

This is not a schema issue but a query issue.  I believe that a
variable is not getting set.  vc is supposed to be a table alias.  We
have fixed a LOT of bugs since 1.2.8.  You might try upgrading and see
if that corrects the issue.

Best Wishes,
Chris Travers