Re: Materialized views WIP patch

Thom Brown <thom@linux.com>

From: Thom Brown <thom@linux.com>
To: Kevin Grittner <kgrittn@mail.com>
Cc: Noah Misch <noah@leadboat.com>, Marko Tiikkaja <pgmail@joh.to>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2013-01-25T10:42:45Z
Lists: pgsql-hackers
On 25 January 2013 06:00, Kevin Grittner <kgrittn@mail.com> wrote:
> Noah Misch wrote:
>
>> The patch conflicts with git master; I tested against master@{2013-01-20}.
>
> New patch rebased, fixes issues raised by Thom Brown, and addresses
> some of your points.

Thanks for the new version.  All previous issues I raised have been resolved.

I have an inconsistency to note between VIEWs and MATERIALIZED VIEWs:

CREATE VIEW v_test8 (meow, "?column?") AS SELECT 1 bark, 2;
CREATE MATERIALIZED VIEW mv_test8 (meow, "?column?") AS SELECT 1 bark, 2;

pg_dump output:

CREATE VIEW v_test8 AS
    SELECT 1 AS meow, 2;

CREATE MATERIALIZED VIEW mv_test8 (
    meow,
    "?column?"
) AS
    SELECT 1 AS meow, 2
  WITH NO DATA;

The materialized view adds in column name parameters, whereas the
standard view doesn't.  But it seems to add column parameters
regardless:

CREATE VIEW v_test9 AS SELECT 1;
CREATE MATERIALIZED VIEW v_test9 AS SELECT 1;

CREATE VIEW v_test9 AS
    SELECT 1;

CREATE MATERIALIZED VIEW mv_test9 (
    "?column?"
) AS
    SELECT 1
  WITH NO DATA;

VIEWs never seem to use column parameters, MATERIALIZED VIEWs always
appear to use them.

--
Thom