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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
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-03-12 14:08:54
Message-ID: 11083.1426169334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> "Marko" == Marko Tiikkaja <marko(at)joh(dot)to> writes:
> Marko> create table qwr();
> Marko> create rule "_RETURN" as on select to qwr do instead select;

> I've wondered for a while whether this wouldn't have been better handled
> as:

> create view qwr(colnames...) as select null::type1, null::type2, ...;
> /* ... */
> create or replace view qwr as ...;

Yeah, possibly. The existing pg_dump coding dates from before we had
CREATE OR REPLACE VIEW.

But we'll have to live with pg_dump files that do this for the indefinite
future, so I agree some fix is needed on the backend side.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-03-12 14:14:48 Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident
Previous Message Andres Freund 2015-03-12 14:07:51 Re: logical column ordering