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

From Tom Lane
Subject Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident
Date
Msg-id 11083.1426169334@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Marko" == Marko Tiikkaja <marko@joh.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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: logical column ordering
Next
From: Andres Freund
Date:
Subject: Re: pg_dump: CREATE TABLE + CREATE RULE vs. relreplident