pg_dump: CREATE TABLE + CREATE RULE vs. relreplident - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject pg_dump: CREATE TABLE + CREATE RULE vs. relreplident
Date
Msg-id 550193C4.8080306@joh.to
Whole thread Raw
Responses Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Hi,

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 consider this a bug fix, and suggest back patching to 9.4.


.m

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: logical column ordering
Next
From: Andrew Gierth
Date:
Subject: Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident