Thread: Strange dump/restore effect

Strange dump/restore effect

From
Gražvydas Valeika
Date:
Hi all,

I just migrated to 9.2 and observing stange thing.

While restoring 9.2 database to another server's empty database I'm getting several errors while restoring views:

pg_restore: creating RULE _RETURN
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 5466; 2618 26660 RULE _RETURN postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error at or near ")"
LINE 2: ALTER VIEW v_vehicle SET ();
                                  ^
    Command was: CREATE RULE "_RETURN" AS ON SELECT TO v_vehicle DO INSTEAD SELECT v.vehicle_id, v.vehicle_code, v.home_location_id, v.vehicl...
pg_restore: creating RULE _RETURN
pg_restore: [archiver (db)] Error from TOC entry 5487; 2618 26835 RULE _RETURN postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error at or near ")"
LINE 2: ALTER VIEW v_r_delivery SET ();

There is lot of views, other are backuped/restored without problems. 
Those several views which are restored with errors are visible in new database as empty tables.

Source database is produced by PostGIS 2.0 migration script from 9.1/PostGIS 1.5 database backup. Attempt to drop those strange views, recreate them and then run dump/restore doesn't change anything.


Same backup/restore procedure worked fine in 9.1.

Any ideas?

Grazvydas


Re: Strange dump/restore effect

From
Gražvydas Valeika
Date:


On Mon, Sep 24, 2012 at 12:44 AM, Paul Ramsey <pramsey@opengeo.org> wrote:
Try just loading the 1.5 dump directly into the 2.0 database without
the filtering step. It will be immensely noisy with lots of errors and
warnings, but with luck you should find your data is there waiting for
you when it's done.


I don't have problems with data. Everything is in place. After droping those 4 tables that happened to be views, and recreating views everything seems ok (till next dump/restore). 

Re: Strange dump/restore effect

From
Tom Lane
Date:
=?UTF-8?Q?Gra=C5=BEvydas_Valeika?= <gvaleika@gmail.com> writes:
> I just migrated to 9.2 and observing stange thing.

> While restoring 9.2 database to another server's empty database I'm getting
> several errors while restoring views:

> pg_restore: creating RULE _RETURN
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 5466; 2618 26660 RULE
> _RETURN postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error
> at or near ")"
> LINE 2: ALTER VIEW v_vehicle SET ();
>                                   ^

Could you provide a self-contained example of a view that causes this?

            regards, tom lane


Re: Strange dump/restore effect

From
Paul Ramsey
Date:
Try just loading the 1.5 dump directly into the 2.0 database without
the filtering step. It will be immensely noisy with lots of errors and
warnings, but with luck you should find your data is there waiting for
you when it's done.

P

On Sun, Sep 23, 2012 at 2:37 PM, Gražvydas Valeika <gvaleika@gmail.com> wrote:
> Hi all,
>
> I just migrated to 9.2 and observing stange thing.
>
> While restoring 9.2 database to another server's empty database I'm getting
> several errors while restoring views:
>
> pg_restore: creating RULE _RETURN
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 5466; 2618 26660 RULE
> _RETURN postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error at
> or near ")"
> LINE 2: ALTER VIEW v_vehicle SET ();
>                                   ^
>     Command was: CREATE RULE "_RETURN" AS ON SELECT TO v_vehicle DO INSTEAD
> SELECT v.vehicle_id, v.vehicle_code, v.home_location_id, v.vehicl...
> pg_restore: creating RULE _RETURN
> pg_restore: [archiver (db)] Error from TOC entry 5487; 2618 26835 RULE
> _RETURN postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error at
> or near ")"
> LINE 2: ALTER VIEW v_r_delivery SET ();
>
> There is lot of views, other are backuped/restored without problems.
> Those several views which are restored with errors are visible in new
> database as empty tables.
>
> Source database is produced by PostGIS 2.0 migration script from 9.1/PostGIS
> 1.5 database backup. Attempt to drop those strange views, recreate them and
> then run dump/restore doesn't change anything.
>
>
> Same backup/restore procedure worked fine in 9.1.
>
> Any ideas?
>
> Grazvydas
>
>