-- 58_cdc_wal2json_overview.sql
-- Banking Pattern Pack — PostgreSQL
-- Purpose: CDC overview with wal2json.
-- Context: Retail bank example with customers, accounts, transactions, cards, loans.
-- Date: 2025-08-18
-- Notes:
--   * Safe to read; run on a development DB.
--   * Requires: CREATE privileges; some files may need superuser for extensions.
--   * Search path set to 'bank' schema for clarity.
SET search_path = bank, public;

-- CDC (wal2json) overview (server config needed)
-- 1) set wal_level=logical
-- 2) SELECT * FROM pg_create_logical_replication_slot('bank_slot','wal2json');
-- 3) Stream changes from the slot with a replication client.
