Re: Row pattern recognition

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: jian(dot)universality(at)gmail(dot)com
Cc: assam258(at)gmail(dot)com, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2026-08-25 07:01:50
Message-ID: 20260825.160150.137890777219580289.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> For me, it's not clear why you add elog(ERROR), rather than Assert. If
>> the infinite loop should not happen when our program is correct, it
>> would be better to fix the problem and use Assert.
>>
>
> Assert will be optimized out in released builds.

Sure.

> Using elog(ERROR) can catch such unlikely errors in release builds.

On the hand if we are confident that the error is truley unlikely
happen, using elog(ERROR) is just a waste of CPU.

> Given how recursive the whole patchset is, even with 100% test coverage, I think
> it would still be better to use elog(ERROR) to guard against some code
> paths that should not be reached.

Ok. You are not confident the errors never happen. If so, using
elog(ERROR) makes sense.

> I also intend to add below at the beginning of nfa_state_free
> ``````
> /* state at the free-list head was freed by the previous call */
> if (unlikely(winstate->nfaStateFree == state))
> elog(ERROR, "double free of RPR NFA state");
> ``````

Looks good to me. Probably we need more elog(ERROR) in nfa modules?

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2026-08-25 07:07:01 Re: XMLSerialize: version and explicit XML declaration
Previous Message Ewan Young 2026-08-25 06:57:18 right() returns the whole string for the most negative n