Re: [BUGS] BUG #14652: pg_dump: VIEW dumped as TABLE - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14652: pg_dump: VIEW dumped as TABLE
Date
Msg-id 18549.1494631675@sss.pgh.pa.us
Whole thread Raw
In response to [BUGS] BUG #14652: pg_dump: VIEW dumped as TABLE  (martellilaurent@gmail.com)
List pgsql-bugs
martellilaurent@gmail.com writes:
> Some views of are dumped as TABLE. And this is really annoying because it
> has "REPLICA IDENTITY NOTHING" which is not understood if I try to restore
> in 9.1. 

There has never been any promise that you could load output from
pg_dump version X into server versions before X without manual
adjustments.  Furthermore, this case doesn't even pose any particular
need for manual adjustments: you need only ignore the error.
I see no bug here.

> But if I dump the whole schema, I get a TABLE with RULE:

FWIW, that typically happens when needed to break a circular dependency.
In this case, since the GROUP BY is obviously inadequate to make the
SELECT legal on its own, I speculate that the query is legal only because
invoice_invoice.id is a primary key, so that the rule has to be emitted
after that pkey constraint is created.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: martellilaurent@gmail.com
Date:
Subject: [BUGS] BUG #14652: pg_dump: VIEW dumped as TABLE
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14651: Uninitialized page fix corrupted TOAST table