Start above the SQL statement
Identify the supplier-plus-code key, required fields, units, feed coverage and source version. A transaction can commit exactly the wrong interpretation. Validating a CSV layout, preserving a code, choosing a mapping and approving publication are separate boundaries. This cluster concerns non-personal product, stock and price data in an existing internal application; it is not a new inventory platform.
- Capture invented input, prior state and desired result.
- Use source documentation to establish feed semantics; generic PostgreSQL docs cannot provide them.
- Keep live supplier acquisition and account access outside first-contact diagnosis.
What PostgreSQL can and cannot enforce
A composite key can protect supplier-local uniqueness. A foreign key can require an existing mapped record. Neither establishes physical product equivalence or whether a pack price is per item. CHECK expressions that evaluate to null pass, so requiredness needs explicit treatment. A conditional upsert can enforce a chosen comparison, but it does not choose the trustworthy freshness source or make a whole multi-row feed atomic by itself.
- Verify the installed database version before relying on a particular constraint syntax.
- Do not add constraints to live data without checking collisions and planning the separate migration.
- Do not suppress a constraint error just to finish an import.
Choose the result you can inspect
For a local defect, demand a regression that fails on the old revision and passes on the repair with the same synthetic inputs. For one new interaction, try an isolated private preview that shows proposed changes and explicit held exceptions. Rejecting a feed must preserve the agreed prior state. The worked examples illustrate policies, not production database tests or customer deliveries.
- Schema migrations, historical correction, concurrency proof and production publication are distinct scopes.
- A successful row count or command is not a product-key, unit or completeness check.
Priced route and boundaries
The existing local bug repair starts from £295 after bounded reproduction and a fixed quote; it excludes production-data or credential-dependent reproduction. The existing one-feature web-app preview starts from £750 with written criteria, an already available private isolated preview, two revision rounds and no new accounts, paid services or sensitive handling changes. Neither offer includes a live supplier connector or inventory redesign. Send invented cases and the application stack initially, not code, credentials or real files. Prices are untested proposals and payment follows the agreed checks and sign-off.
Sources and limits
- PostgreSQL constraints: guarantees and null limitations Checked 2026-10-11.
- Composite keys constrain combined values; a CHECK passes if its expression is true or null.
- PostgreSQL INSERT conflict handling Checked 2026-10-11.
- Conditional conflict handling and input cardinality rules are database mechanisms, not supplier meaning or source freshness contracts.
- Existing bounded local bug repair Checked 2026-10-11.
- Existing bounded web-app preview feature Checked 2026-10-11.