Thread: BUG #2326: Problems Upgrading from 8.0.2

BUG #2326: Problems Upgrading from 8.0.2

From
"Dan B."
Date:
The following bug has been logged online:

Bug reference:      2326
Logged by:          Dan B.
Email address:      thedanburke@hotmail.com
PostgreSQL version: 8.1.3
Operating system:   Mac OS X 10.4.1
Description:        Problems Upgrading from 8.0.2
Details:

I'm trying to restore a database dumpall from postgres 8.0.2 to an 8.1.3
installation on the same machine but have encountered an error which has
resulted in some views not being recreated.

the problem is with the following statement in the dump file:

"CREATE VIEW wamp_product_extdesc AS
    SELECT  contenttranslation.franchise_code,
            contenttranslation.contentobject_id,
            "language".code AS language_code,
            "language".uid AS language_id,
            contenttranslation.info,
            contenttranslation.graphic_url,
            contenttranslation.contenttype_id,
            contenttype.info AS contenttype_code
   FROM    contenttranslation, "language" contenttype
   WHERE (("language".uid = contenttranslation.language_id) AND
(contenttype.uid = contenttranslation.contenttype_id));"

Which results in:
" psql:backuptoday.bak:5182: ERROR:  missing FROM-clause entry for table
"language" "

Any help would be appreciated,
Dan

Re: BUG #2326: Problems Upgrading from 8.0.2

From
Tom Lane
Date:
"Dan B." <thedanburke@hotmail.com> writes:
> I'm trying to restore a database dumpall from postgres 8.0.2 to an 8.1.3
> installation on the same machine but have encountered an error which has
> resulted in some views not being recreated.
> ...
> " psql:backuptoday.bak:5182: ERROR:  missing FROM-clause entry for table
> "language" "

You can reload that view by turning on add_missing_from first.
Re-dumping it will show it in the correct format with an additional
FROM entry.

Note: it seems highly likely to me that that view doesn't do what it's
supposed to anyway, and that you ought to change it.  What you've got
there is a partially constrained 3-way join using two scans of the
language table ... is that what you meant?  But if you want to reload it
with the same behavior it has now, add_missing_from is your friend.

            regards, tom lane