REJECT_LIMIT can keep a bulk load moving through a small number of malformed rows, but rejected data still needs an auditable path. This article focuses on the decision a reader must make, the evidence worth collecting, and the failure modes that a short definition usually misses.
Treat examples as a starting point. Versions, deployment topology, traffic shape, and failure tolerance can change the correct implementation.
The decision behind PostgreSQL COPY REJECT_LIMIT
The useful question is not whether the concept is “good” or “bad.” Ask what job it performs, what assumptions must hold, and what happens when those assumptions fail. Write those conditions before changing code, moving money, submitting a form, or trusting a claim. That turns a vague topic into a decision that can be reviewed later.
For this subject, the central claim is: REJECT_LIMIT can keep a bulk load moving through a small number of malformed rows, but rejected data still needs an auditable path. Keep that sentence beside the evidence. If the evidence does not test it, extra dashboards, ratios, or screenshots only create confidence without clarity.
Work through this real situation
Consider a 2 million-row partner CSV containing 37 malformed timestamps. Start with a baseline and keep unrelated variables unchanged. Use at least 3 representative runs or checks instead of trusting one convenient result. The point of the example is not to predict one universal result; it is to expose which input actually controls the outcome.
Write the known facts in one column and assumptions in another. A quoted return is not a guaranteed return. A successful local test is not production reliability. An official-looking message is not proof of identity. Separating facts from assumptions prevents urgency from doing the reasoning for you.
baseline -> controlled change -> observable result -> rollback check
case: postgresql-copy-reject-limit-bulk-imports
Evidence worth collecting
Look for evidence that can disprove the attractive story. Useful signals include the current official documentation, the exact fee or version, several periods rather than one winning snapshot, and the behavior under a realistic failure. Save dates with measurements because a number without its period is easy to misuse.
For comparisons, keep the units and scope identical. Compare annual cost with annual cost, p95 latency with p95 latency, and the same benchmark or eligibility category on both sides. If two options solve different problems, a single ranking table is misleading.
A safe sequence to follow
- Load into a staging table. Record what you checked, where the information came from, and what result would make you stop.
- Set a deliberate reject ceiling. Record what you checked, where the information came from, and what result would make you stop.
- Capture rejected rows separately. Record what you checked, where the information came from, and what result would make you stop.
- Validate totals and constraints. Record what you checked, where the information came from, and what result would make you stop.
- Promote in one controlled transaction. Record what you checked, where the information came from, and what result would make you stop.
Do one reversible step first. Review the result before continuing, especially when the action can affect production data, tax, account access, or money. A checklist is useful only when each item produces evidence; clicking through five screens is activity, not verification.
Where people get misled
- Treating a popular outcome as proof that the process was sound.
- Comparing numbers from different dates, categories, workloads, or risk levels.
- Ignoring costs around the main number: spread, tax, downtime, support work, or recovery.
- Acting from urgency before checking the official source independently.
- Keeping no rollback, exit rule, or record of why the decision was made.
The strongest protection is a written stop condition. Decide in advance what error rate, cost, price movement, missing document, or unverifiable claim means “do not continue.” This is more reliable than inventing a reason after commitment.
Official material used
The practical conclusion is modest: understand the mechanism, test it against your own constraint, and keep the decision reversible where possible. That approach is slower than reacting to a headline, but it produces evidence another person can inspect and reuse.
Discussion
What would you try, change, or challenge after reading this guide? Specific results and errors help the next reader.
Comments will load as you reach this section.