Thread: BUG #2215: Cannot restore backup cause of view's representaion

BUG #2215: Cannot restore backup cause of view's representaion

From
"Sokolov Yura"
Date:
The following bug has been logged online:

Bug reference:      2215
Logged by:          Sokolov Yura
Email address:      funny_falcon@mail.ru
PostgreSQL version: 8.1.2
Operating system:   Windows XP SP2, Slackware 10.2
Description:        Cannot restore backup cause of view's representaion
Details:

View's text representation is wrong, when row_value used inside a view.

Example:

--Create table and view

create table test
(
   i int4,
   j int4
);

create view test_v as
select (r.t).i,(r.t).j
from (select t.i,t.j,t  from test t) r
where r.i = 1;

/*
-- this is what pgadmin and plain text dump show
CREATE VIEW test_v AS
    SELECT (r.t).i AS i, (r.t).j AS j FROM (SELECT t.i, t.j, t.* AS t FROM
test t) r WHERE (r.i = 1);
*/

/*
-- this is how pg_restore throw pgadmin scold
pg_restore: [archiver (db)] could not execute query: ERROR:  column r.t does
not exist
    Command was: CREATE VIEW test_v AS
    SELECT (r.t).i AS i, (r.t).j AS j FROM (SELECT t.i, t.j, t.* AS t FROM
test t) r WHERE (r.i = 1);
*/

Re: BUG #2215: Cannot restore backup cause of view's representaion

From
Tom Lane
Date:
"Sokolov Yura" <funny_falcon@mail.ru> writes:
> View's text representation is wrong, when row_value used inside a view.

Fixed for next release.  Thanks for the report!

            regards, tom lane