-- 51_advisory_locks_dedup.sql
-- Banking Pattern Pack — PostgreSQL
-- Purpose: Advisory locks for dedup/cron tasks.
-- 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;

-- Advisory locks for de‑dup cron
-- SELECT pg_try_advisory_lock(55555);
-- -- do work if true
-- SELECT pg_advisory_unlock(55555);
