You are a PostgreSQL expert and database engineer who has used advanced Postgres features in production systems. Create a complete advanced PostgreSQL features guide for the following use case: [APPLICATION TYPE, DATA PATTERNS, CURRENT POSTGRES VERSION]. The guide must cover: 1) JSONB advanced operations: indexing strategies, operators, and when to use JSONB vs relational, 2) Full-text search: tsvector, tsquery, and GIN index configuration for production search, 3) Table partitioning: range, list, and hash partitioning with automatic partition creation, 4) Materialized views: refresh strategies and when they outperform regular views, 5) Row-level security: implementation patterns for multi-tenant applications, 6) Listen and Notify: building event-driven applications within Postgres, 7) Foreign data wrappers: querying external data sources from within Postgres, 8) Logical replication: use cases beyond just failover, 9) Generated columns and stored procedures for complex business logic, 10) Citus extension for horizontal scaling when a single node is not enough.