New rules: ban dropping views, functions, types, triggers, and column defaults
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by locating the existing ban-drop-column rule and its related tests, then trace how PostgreSQL statements are parsed and compatibility rules are registered. Done means coverage for dropping views, functions or procedures, types, defaults, and triggers, with behavior consistent with the existing rule naming and messages.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, and thanks for Squawk! We run it in CI to verify that the previously deployed version of an app still runs against the new schema, so a rollback remains possible.
The ban-drop-*, renaming-*, and changing-column-type rules cover tables and columns well. Dropping other objects that application code depends on, however, is not covered.
On 2.66.0, none of these statements reports a compatibility rule. Only prefer-robust-stmts fires, on some of them:
DROP VIEW v;
DROP MATERIALIZED VIEW mv;
DROP FUNCTION f(int);
DROP TYPE t;
DROP TRIGGER trg ON tbl;
ALTER TABLE tbl ALTER COLUMN c DROP DEFAULT;
For comparison, ALTER TABLE tbl DROP COLUMN c reports ban-drop-column.
How these break existing clients:
DROP VIEW/DROP MATERIALIZED VIEW: queries against the view fail with42P01 undefined_table.DROP FUNCTION/DROP PROCEDURE: calls fail with42883 undefined_function.DROP TYPE: casts or parameters that name the type fail with42704 undefined_object. WithCASCADE, it also drops every column of that type.ALTER COLUMN ... DROP DEFAULT: inserts that omit the column fail with23502 not_null_violationon aNOT NULLcolumn. On a nullable column, they silently writeNULL.DROP TRIGGER: nothing errors, but code that relied on the trigger (e.g. maintainingupdated_ator writing audit rows) silently loses that behaviour. This one, is a bit less important though, so I'd leave this up to your judgement.
I suggest adding the following rules, using the existing naming (roughly in priority order):
ban-drop-view(including materialized views)ban-drop-function(including procedures)ban-drop-typeban-drop-defaultban-drop-trigger
The problem and solution text could mirror ban-drop-column: "Dropping a view may break existing clients. Update your application code to no longer use the view, then drop it in a later migration."
Related: #316, since these would fit the backwards-compatibility group suggested there, and #937, which makes the same case for rolling deploys and rollbacks.
Happy to open a PR for any of these if you're open to it. Thanks!
- Lingua principale
- Rust
- Stelle
- 1.2k
- Fork
- 72
- Merge medio
- 2h 44m
- PR unite (30g)
- 51
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sbdchd/squawk
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
sbdchd/squawk#1294 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
sbdchd/squawk#1278 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
sbdchd/squawk#1261 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
sbdchd/squawk#1230 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
sbdchd/squawk#1228 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sbdchd/squawk
Issue simili
-
agent:triaged bug bughunt pm:bundler priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SocketDev/socket-patch#1573 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
rustix::termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOSAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bytecodealliance/rustix#1706 · 1 commento ·
I maintainer di solito rispondono entro 11 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wormhole-foundation/wormhole#5062 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno