Re: Error-safe user functions

2022-12-24 Thread Andrew Dunstan
On 2022-12-24 Sa 10:42, Tom Lane wrote: > Andrew Dunstan writes: >> As I was giving this a final polish I noticed this in jspConvertRegexFlags: >>     /* >>      * We'll never need sub-match details at execution.  While >>      * RE_compile_and_execute would set this flag anyway, force it on

Re: ARRNELEMS Out-of-bounds possible errors

2022-12-24 Thread Tom Lane
Nikita Malakhov writes: > Even with null context it does not turn to ereport, and returns dummy value Read the code. ArrayGetNItems passes NULL for escontext, therefore if there's a problem the ereturn calls in ArrayGetNItemsSafe will throw error, *not* return -1. Not sure how we could

Re: Error-safe user functions

2022-12-24 Thread Tom Lane
Ted Yu writes: > On Fri, Dec 23, 2022 at 1:22 PM Tom Lane wrote: >> Yes, it is. We don't want a query-cancel transformed into a soft error. > The same regex, without user interruption, would exhibit an `invalid > regular expression` error. On what grounds do you claim that? The timing of

Re: Error-safe user functions

2022-12-24 Thread Tom Lane
Andrew Dunstan writes: > As I was giving this a final polish I noticed this in jspConvertRegexFlags: >     /* >      * We'll never need sub-match details at execution.  While >      * RE_compile_and_execute would set this flag anyway, force it on here to >      * ensure that the regex cache

Re: ARRNELEMS Out-of-bounds possible errors

2022-12-24 Thread Nikita Malakhov
Hi, Even with null context it does not turn to ereport, and returns dummy value - #define errsave_domain(context, domain, ...) \ do { \ struct Node *context_ = (context); \ pg_prevent_errno_in_scope(); \ if (errsave_start(context_, domain)) \ __VA_ARGS__, errsave_finish(context_, __FILE__,

Re: Error-safe user functions

2022-12-24 Thread Ted Yu
On Sat, Dec 24, 2022 at 4:38 AM Andrew Dunstan wrote: > > On 2022-12-24 Sa 04:51, Ted Yu wrote: > > > > > > On Fri, Dec 23, 2022 at 1:22 PM Tom Lane wrote: > > > > Ted Yu writes: > > > In makeItemLikeRegex : > > > > > + /* See regexp.c for explanation */ > >

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-24 Thread Bharath Rupireddy
On Sat, Dec 24, 2022 at 12:58 AM David Christensen wrote: > > On Fri, Dec 23, 2022 at 12:57 PM David Christensen > wrote: > > > > On Wed, Dec 21, 2022 at 5:47 AM Bharath Rupireddy > > wrote: > > > > 2. +$node->init(extra => ['-k'], allows_streaming => 1); > > > When enabled with

[PoC] Implementation of distinct in Window Aggregates

2022-12-24 Thread Ankit Pandey
Hi, This is a PoC patch which implements distinct operation in window aggregates (without order by and for single column aggregation, final version may vary wrt these limitations). Purpose of this PoC is to get feedback on the approach used and corresponding implementation, any nitpicking as

Re: Error-safe user functions

2022-12-24 Thread Andrew Dunstan
On 2022-12-23 Fr 13:53, Tom Lane wrote: > Andrew Dunstan writes: >> On 2022-12-22 Th 11:44, Tom Lane wrote: >>> (I wonder why this is using RE_compile_and_cache at all, really, >>> rather than some other API. There doesn't seem to be value in >>> forcing the regex into the cache at this

Re: Error-safe user functions

2022-12-24 Thread Andrew Dunstan
On 2022-12-24 Sa 04:51, Ted Yu wrote: > > > On Fri, Dec 23, 2022 at 1:22 PM Tom Lane wrote: > > Ted Yu writes: > > In makeItemLikeRegex : > > > +                       /* See regexp.c for explanation */ > > +                       CHECK_FOR_INTERRUPTS(); > > +               

Re: Force streaming every change in logical decoding

2022-12-24 Thread Dilip Kumar
On Sat, Dec 24, 2022 at 8:56 AM Amit Kapila wrote: > > > > > > > OK, I removed the modification in 022_twophase_cascade.pl and combine the > > > two patches. > > > > Thank you for updating the patch. The v6 patch looks good to me. > > > > LGTM as well. I'll push this on Monday. > The patch

Re: Error-safe user functions

2022-12-24 Thread Ted Yu
On Fri, Dec 23, 2022 at 1:22 PM Tom Lane wrote: > Ted Yu writes: > > In makeItemLikeRegex : > > > + /* See regexp.c for explanation */ > > + CHECK_FOR_INTERRUPTS(); > > + pg_regerror(re_result, _tmp, errMsg, > > sizeof(errMsg));

Re: daitch_mokotoff module

2022-12-24 Thread Dag Lem
Dag Lem writes: > Alvaro Herrera writes: > >> On 2022-Dec-23, Alvaro Herrera wrote: >> > > [...] > >> I tried downloading a list of surnames from here >> https://www.bibliotecadenombres.com/apellidos/apellidos-espanoles/ >> pasted that in a text file and \copy'ed it into a table. Then I ran >>