Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident
Date: 2015-05-01 17:03:39
Message-ID: 20150501170339.GC26678@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 12, 2015 at 03:14:48PM +0100, Andres Freund wrote:
> Hi,
>
> On 2015-03-12 14:25:24 +0100, Marko Tiikkaja wrote:
> > My colleague Per Lejontand brought to my attention that when dumping views
> > with circular dependencies from a postgres version older than 9.4 using a
> > recent pg_dump, the SQL looks something like the following:
> >
> > create table qwr();
> > create rule "_RETURN" as on select to qwr do instead select;
> >
> > In this case the relreplident column in pg_class for the view ends up being
> > 'd', instead of the 'n' normally used for views. Patch to update
> > relreplident when turning a table into a view is attached; this makes sure
> > that the identity is NOTHING regardless of how the view was created.
>
> I think that's a good idea.
>
> > I consider this a bug fix, and suggest back patching to 9.4.
>
> I agree on backpatching it. Arguably we could additionally avoid
> emitting the ALTER TABLE ... REPLICA IDENTITY for views that have
> already been created with identity set like this. But I doubt it's worth
> it.

Applied and backpatched to 9.4.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-05-01 17:05:19 Re: feature freeze and beta schedule
Previous Message Peter Geoghegan 2015-05-01 16:49:50 Re: feature freeze and beta schedule