Closed nuko-yokohama closed 4 years ago
In "commit e150d964df7e3aeb768e4bae35d15764f8abd284", it was confirmed that a query containing a LIMIT clause and an OFFSET clause failed. This issue will be closed.
CREATE INCREMENTAL MATERIALIZED VIEW test_imv AS SELECT * FROM test LIMIT 1;
psql:limit-problem.sql:5: ERROR: LIMIT/OFFSET clause is not supported with IVM
CREATE INCREMENTAL MATERIALIZED VIEW test_imv2 AS SELECT * FROM test OFFSET 1;
psql:limit-problem.sql:7: ERROR: LIMIT/OFFSET clause is not supported with IVM
In SQL, the result of a LIMIT clause without ORDER BY is undefined. If the LIMIT clause is allowed when creating an incremental materialized view, incorrect results will be obtained when the view is updated after updating the source table.
ORDER BY clause is not allowed when executing CREATE INCREMENTAL MATELIARIZED VIEW. We propose not to allow LIMIT clauses as well.