Re: pgsql: Add CREATE RECURSIVE VIEW syntax

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add CREATE RECURSIVE VIEW syntax
Date: 2013-03-01 04:21:21
Message-ID: 1362111681.19221.1.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, 2013-02-28 at 14:38 +0000, Thom Brown wrote:
> Recursive views aren't updatable, but the error message may be
> considered a bit confusing to those who don't realise that recursive
> views are converted to recursive CTEs.
>
> postgres=# UPDATE vpeople SET last_person = last_person || ' test';
> ERROR: cannot update view "vpeople"
> DETAIL: Views containing WITH are not automatically updatable.
> HINT: To make the view updatable, provide an unconditional ON UPDATE
> DO INSTEAD rule or an INSTEAD OF UPDATE trigger.
>
> Could we perhaps modify the error message in such scenarios to
> something like: "Views containing WITH, including recursive views, are
> not automatically updatable."

If a user saw that error message and did a \d on the view, it would show
the expanded form with WITH, so I think the message is fine as it is.

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Ants Aasma 2013-03-01 13:56:42 Re: Materialized views WIP patch
Previous Message Alvaro Herrera 2013-02-28 19:34:42 pgsql: Improve pg_upgrade commentary on multixact change