Re: Error message for CREATE VIEW is confusing - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Error message for CREATE VIEW is confusing
Date
Msg-id CA+TgmobaA8NucDFxLa-4Fvv+Z70O=tOGM5GTP8-nV3_A1NbdWw@mail.gmail.com
Whole thread Raw
In response to Error message for CREATE VIEW is confusing  (Pavel Golub <pavel@microolap.com>)
List pgsql-hackers
On Wed, Jul 31, 2013 at 6:49 AM, Pavel Golub <pavel@microolap.com> wrote:
> Hello, PostgreSQL.
>
> Let's assume we have created MATERIALIZED VIEW, e.g.
>
> CREATE MATERIALIZED VIEW customer_v AS SELECT ....;
>
> Then one wants to redefine this view as a regular view, e.g.
>
> CREATE OR REPLACE VIEW customer_v AS ....;
>
> Error is rising:
> ERROR:  "customer_v" is not a view
> ********** Error **********
> ERROR: "customer_v" is not a view
> SQL-state: 42809
>
> Should we change error message to something like "customer_v" has wrong
> object type" (according to errcode appendix)? Or should we change word
> "view" to "regular view" since we have "materialized" already, e.g.
> "customer_v" is not a regular view"?

Well, this is another instance of the general problem that some people
think that "view" ought to mean "materialized view", but it doesn't.
I'm not inclined to go too crazy trying to clear up all possible
ambiguities in this area, because I think it's a rat's nest that will
never really work out well as long as people think those two things
are somehow the same.  One idea is to add a hint:

HINT: It is a materialized view.

But I'm not sure whether that's a good idea or not.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Atri Sharma
Date:
Subject: Re: Should we automatically run duplicate_oids?
Next
From: Stephen Frost
Date:
Subject: Re: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])