Re: backend crash on DELETE, reproducible locally

Karsten Hilbert <karsten.hilbert@gmx.net>

From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, pgsql-general@lists.postgresql.org
Date: 2018-11-01T16:00:07Z
Lists: pgsql-hackers, pgsql-general
On Thu, Nov 01, 2018 at 11:43:56AM -0400, Tom Lane wrote:

> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Ah, now this is interesting.  Can you please supply the definition of
> > the table?  I'm wondering if there is a partitioned table with an FK to
> > this one.  I'm not quite seeing how come 'tup' is NULL there.
> 
> Yeah, apparently we've passed a null OLD tuple to an RI_FKey_cascade_del
> trigger, which surely shouldn't happen.  It'd be interesting to look at
> the set of triggers on this table.  I don't entirely trust psql's \d
> to show us reality if there's something screwed up about the triggers,
> so in addition to \d output, could we see
> 
> select * from pg_trigger where tgrelid  = 'ref.auto_hint'::regclass;

Ausgabeformat ist »wrapped«.
 tgrelid |            tgname             | tgfoid | tgtype | tgenabled | tgisinternal | tgconstrrelid | tgconstrindid | tgconstraint | tgdeferrable | tginitdeferred | tgnargs | tgattr | tgargs | tgqual | tgoldtable | tgnewtable 
---------+-------------------------------+--------+--------+-----------+--------------+---------------+---------------+--------------+--------------+----------------+---------+--------+--------+--------+------------+------------
  111088 | RI_ConstraintTrigger_a_116970 |   1646 |      9 | O         | t            |        116789 |        111099 |       116969 | f            | f              |       0 |        | \x     |        |            | 
  111088 | RI_ConstraintTrigger_a_116971 |   1649 |     17 | O         | t            |        116789 |        111099 |       116969 | f            | f              |       0 |        | \x     |        |            | 
  111088 | zt_ins_auto_hint              | 141652 |      7 | O         | f            |             0 |             0 |            0 | f            | f              |       0 |        | \x     |        |            | 
  111088 | zt_upd_auto_hint              | 141654 |     19 | O         | f            |             0 |             0 |            0 | f            | f              |       0 |        | \x     |        |            | 
  111088 | zt_del_auto_hint              | 141656 |     11 | O         | f            |             0 |             0 |            0 | f            | f              |       0 |        | \x     |        |            | 
(5 Zeilen)


BTW, do you want me to attach text files or include into the
body (potential wrapping issues on display) ?

Thanks,
Karsten
-- 
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B


Commits

  1. Disable recheck_on_update optimization to avoid crashes.

  2. Allow HOT updates for some expression indexes