sqlpostgresqlpostgresql-9.3postgresql-9.4largeobject

SQL Error [42704]: ERROR: large object xxxxxxx does not exist


I had a table with large object. When I want to delete a row. I have an error: SQL Error [42704]:

ERROR: large object 123456 does not exist.

I checked in pg_largeobject and I didn't find a row with id = '123456'.

How can I delete an row which has a nonexistent object?

The trigger on the table is

CREATE TRIGGER t_filledreport BEFORE UPDATE OR DELETE ON rep_reportjob
   FOR EACH ROW EXECUTE PROCEDURE lo_manage(filledreport);

Solution

  • There are two options:

    Caution! With triggers disabled, you can easily introduce inconsistencies!