On 06/26/2018 05:34 PM, Pavel Stehule wrote:
> 2018-06-26 17:23 GMT+02:00 Peter Moser <pitiz29a@gmail.com
> <mailto:pitiz29a@gmail.com>>:
> What do you think, is it worth to create a patch to solve this
> issue, where a DROP TABLE does not fail, if the given name is
> actually a VIEW or vice-versa?
>
>
> DROP TABLE should to remove table and nothing else, like DROP VIEW
> should to drop just view and nothing else. It is safeguard.
My last sentence is misleading. What I thought is:
DROP TABLE X;
Should not delete a view X, and result in an error only if table X does
not exist. It should not look at views for error handling, maybe just as
hint that there is a view X and we might use DROP VIEW X instead.
DROP TABLE IF EXISTS X;
Should also not delete a view X, and not result in any error if X is a
view and not a table.
Hopefully I explained things better now.
Cheers,
Peter