This demo shows the core OhMyDB safety flow against PostgreSQL:
- A normal SELECT passes through the proxy.
- A risky UPDATE without a WHERE clause is intercepted.
- OhMyDB classifies the operation as critical.
- The query is blocked before it modifies the database.
- A follow-up query verifies that the data remained unchanged.
Before running the walkthrough:
- use a disposable local database
- never point the demo at production
- reset demo data before repeating the mutation test
- confirm the client is connecting through the OhMyDB proxy port
- keep backups and normal database safeguards in place
ohmydb --version
ohmydb
Connect the PostgreSQL client to the OhMyDB listening port rather than directly to the database backend.
Example:
psql -h 127.0.0.1 -p 5433 -U postgres -d ohmydb_demo
Before running the demo, make sure the client is connecting to the OhMyDB listening port rather than directly to the database backend.
Typical local setup:
PostgreSQL backend: 5432
OhMyDB proxy: 5433
A client connection to port 5433 confirms traffic is passing through OhMyDB before reaching PostgreSQL.
SELECT id, name, status
FROM demo_customers
ORDER BY id;
UPDATE demo_customers
SET status = 'inactive';
Because the UPDATE has no WHERE clause, OhMyDB evaluates it as a potentially full-table mutation and applies the configured safety policy before execution.
For an UPDATE without a WHERE clause, the client should receive a blocked-query response describing the policy decision.
Typical result:
Query blocked by OhMyDB
Severity: CRITICAL
Operation: UPDATE
The exact wording may vary with configuration, but the mutation should not reach the backend when the active policy blocks it.
SELECT COUNT(*) AS inactive_customers
FROM demo_customers
WHERE status = 'inactive';
When the mutation is blocked, the result remains:
inactive_customers
------------------
0
To repeat the walkthrough, reset the demo rows before running the risky mutation again:
UPDATE demo_customers
SET status = 'active';
Verify the reset:
SELECT id, name, status
FROM demo_customers
ORDER BY id;
This keeps repeated local demonstrations deterministic and avoids carrying state from an earlier run.
OhMyDB can apply:
ALLOW
CONFIRM
BLOCK
The project follows a fail-closed approach for malformed, ambiguous, unsupported, or otherwise unsafe database behavior.
For full configuration and supported protocol details, see the main README.