Giter VIP home page Giter VIP logo

Comments (5)

Tishj avatar Tishj commented on June 26, 2024

That PR is not relevant here, this one is
#11493

Views create dependencies now

from duckdb.

Tishj avatar Tishj commented on June 26, 2024

Doesn't requiring the use of DROP...CASCADE defeat the purpose of CREATE OR REPLACE

I don't agree, I just think what is missing here is the option to provide CASCADE to CREATE OR REPLACE
They control two different intentions

CREATE OR REPLACE indicates your intent to drop the table, it doesn't necessarily indicate your intent to drop the views/indexes/sequences, etc.. that have a dependency on the table

We could argue whether the VIEW should be recreated instead of dropped if CASCADE is provided, but that's a different discussion. I don't think performing a CASCADE implicitly when OR REPLACE is used is the right move

from duckdb.

izeigerman avatar izeigerman commented on June 26, 2024

We could argue whether the VIEW should be recreated instead of dropped if CASCADE is provided, but that's a different discussion. I don't think performing a CASCADE implicitly when OR REPLACE is used is the right move

I do believe that CREATE OR REPLACE should not be destructive towards downstream dependencies. With or without CASCADE.

A typical use case for CREATE OR REPLACE is to atomically refresh the entire table / view without changing the schema and without exposing the clients to partial (empty) data caused by the intermediate table truncation step. Though the argument can be made that this can be achieved by doing these 2 steps as part of a transaction. But this doesn't help with views.

Another use case is to change both data and the schema of the table in a non-descrtuctive way.

The existing behavior renders the latter use cases impossible. Is there a way to disable binding for views and go back to previous behavior?

from duckdb.

aersam avatar aersam commented on June 26, 2024

This also broke us, for me this is really unexpected. CREATE OR REPLACE should really not be destructive, and it's heavily breaking

from duckdb.

Mytherin avatar Mytherin commented on June 26, 2024

#12209 adds a new setting for view dependencies (enable_view_dependencies) which now defaults to false

from duckdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.