From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: terence.zekveld@eoh.com
Subject: BUG #15384: dropping views and materialized views
Date: Fri, 14 Sep 2018 09:40:39 +0000
Message-ID: <153691803945.22350.17400062274182452899@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15384
Logged by: Terence Zekveld
Email address: terence.zekveld@eoh.com
PostgreSQL version: 9.6.1
Operating system: Windows
Description:
Sometimes we change a view to a materialized view.
We have a general upgrading script to update all our postgres db's to keep
them in sync.
So I like to add this to my general upgrading script before creating the
materialized view:
DROP VIEW IF EXISTS theschema.theviewname; --
for in case this db still has the 'un'materialized view
DROP MATERIALIZED VIEW IF EXISTS theschema.theviewname; -- for in case this
db already has an older version of the materialized view
CREATE MATERIALIZED VIEW theschema.theviewname AS ...
But either the 1st or the 2nd DROP functions throw an error, either
"theschema.theviewname is not a view" or "theschema.theviewname is not a
materialized view".
I would think these errors are not relevant when using the "IF EXISTS"
option, i.e. it should execute both, 'skipping' the one that refers to the
incorrect type of view...
Kind regards, and thanks for a great db,
Terence
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, terence.zekveld@eoh.com
Subject: Re: BUG #15384: dropping views and materialized views
In-Reply-To: <153691803945.22350.17400062274182452899@wrigleys.postgresql.org>
References: <153691803945.22350.17400062274182452899@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox