gendesign/data/sql/188_regrant_quarter_price_index_fdw.sql
bot-backend e84c613edc
All checks were successful
CI Trade-In / changes (pull_request) Successful in 8s
CI / changes (pull_request) Successful in 9s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 2m0s
CI / backend-tests (pull_request) Successful in 15m12s
fix(sql): re-grant mv_quarter_price_index to tradein_fdw_reader (C3, #2583)
179's DROP MATERIALIZED VIEW ... CASCADE recreated mv_quarter_price_index
without restoring 99b's GRANT — since 2026-07-05 the tradein estimator's
FDW read (quarter_price_index) failed with permission denied. Applied live
on prod 2026-08-04 (verified: 1894 rows readable from tradein). 188 codifies
the grant idempotently; 179 now re-grants after its CASCADE recreate so a
re-run can't lose it again.
2026-08-04 23:16:08 +05:00

22 lines
1.3 KiB
PL/PgSQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 188_regrant_quarter_price_index_fdw.sql
-- C3 (#2583): tradein-эстиматор потерял квартальный индекс 2026-07-05.
--
-- Причина: 179_mv_quarter_price_cadastral_floor.sql делает
-- DROP MATERIALIZED VIEW mv_quarter_price_index CASCADE; CREATE ...
-- DROP+CREATE не сохраняет гранты — GRANT из 99b_grant_quarter_price_index_fdw.sql
-- пропал, и tradein-сторона (foreign table quarter_price_index, роль
-- tradein_fdw_reader) с 05.07 получала:
-- permission denied for materialized view mv_quarter_price_index
--
-- Симптом «не выполняется с 5 июля» — это дата применения 179, а не поломка
-- рефреша: REFRESH MATERIALIZED VIEW (beat: 05:00 МСК 5-го числа) гранты не трогает.
--
-- Применено вживую на прод 2026-08-04 (FDW-чтение проверено: 1894 строки).
-- Этот файл — идемпотентное закрепление. Парный фикс: GRANT дописан в конец 179,
-- чтобы повторное применение 179 больше не теряло грант.
BEGIN;
GRANT SELECT ON public.mv_quarter_price_index TO tradein_fdw_reader;
COMMIT;