# `Alternera.Resource.Changes.RefuseReferencedDelete`
[🔗](https://github.com/10e-ab/alternera-sdk/blob/v0.9.0/alternera_resource_sdk/lib/alternera/resource/changes/refuse_referenced_delete.ex#L1)

On every destroy of a resource-package resource: when the database refuses
the delete because other records reference the record (AshPostgres reports
"would leave records behind"), the error becomes
`Alternera.Resource.Errors.Referenced`, which the REST API answers with
409 and the other surfaces can tell from a validation error.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
