Re: TRIM_ARRAY

2021-03-03 Thread Vik Fearing
On 3/3/21 10:47 PM, Tom Lane wrote: > > I had the same problem as Dian of the func.sgml hunk winding up in > the wrong place. I think this is practically inevitable unless the > submitter uses more than 3 lines of context for the diff, because > otherwise the context is just boilerplate that look

Re: TRIM_ARRAY

2021-03-03 Thread Tom Lane
Vik Fearing writes: > On 3/2/21 1:02 AM, Dian M Fay wrote: >> I'd thought that checking v and returning null instead of raising the >> error would be more friendly, should it be possible to pass an untyped >> null accidentally instead of on purpose, and I couldn't rule that out. > As Tom said, th

Re: TRIM_ARRAY

2021-03-01 Thread Vik Fearing
On 3/2/21 1:02 AM, Dian M Fay wrote: > On Mon Mar 1, 2021 at 6:53 PM EST, Vik Fearing wrote: >>> This basically does what it says, and the code looks good. The >>> documentation is out of alphabetical order (trim_array should appear >>> under cardinality rather than over)) but good otherwise. >> >>

Re: TRIM_ARRAY

2021-03-01 Thread Dian M Fay
On Mon Mar 1, 2021 at 6:53 PM EST, Vik Fearing wrote: > > This basically does what it says, and the code looks good. The > > documentation is out of alphabetical order (trim_array should appear > > under cardinality rather than over)) but good otherwise. > > Hmm. It appears between cardinality and

Re: TRIM_ARRAY

2021-03-01 Thread Tom Lane
Dian Fay writes: > This basically does what it says, and the code looks good. The > documentation is out of alphabetical order (trim_array should appear > under cardinality rather than over)) but good otherwise. I was able to > "break" the function with an untyped null in psql: > select trim_arra

Re: TRIM_ARRAY

2021-03-01 Thread Vik Fearing
On 3/2/21 12:14 AM, Dian Fay wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: tested, failed > Documentation:tested, failed Thank you for l

Re: TRIM_ARRAY

2021-03-01 Thread Dian Fay
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, failed Documentation:tested, failed This basically does what it says, and the code looks good. Th

Re: TRIM_ARRAY

2021-02-20 Thread Vik Fearing
On 2/17/21 1:25 AM, Vik Fearing wrote: > I've made a bit of a mess out of this, but I partly blame the standard > which is very unclear. It actually describes trimming the right n > elements instead of the left n like I've done here. I'll be back later > with a better patch that does what it's a

Re: TRIM_ARRAY

2021-02-16 Thread Vik Fearing
On 2/16/21 11:38 PM, Vik Fearing wrote: > On 2/16/21 7:32 PM, Isaac Morland wrote: >> On Tue, 16 Feb 2021 at 12:54, Vik Fearing wrote: >> >>> The SQL standard defines a function called TRIM_ARRAY that surprisingly >>> has syntax that looks like a function! So I implemented it using a thin >>> wra

Re: TRIM_ARRAY

2021-02-16 Thread Vik Fearing
On 2/16/21 7:32 PM, Isaac Morland wrote: > On Tue, 16 Feb 2021 at 12:54, Vik Fearing wrote: > >> The SQL standard defines a function called TRIM_ARRAY that surprisingly >> has syntax that looks like a function! So I implemented it using a thin >> wrapper around our array slice syntax. It is lit

Re: TRIM_ARRAY

2021-02-16 Thread Isaac Morland
On Tue, 16 Feb 2021 at 12:54, Vik Fearing wrote: > The SQL standard defines a function called TRIM_ARRAY that surprisingly > has syntax that looks like a function! So I implemented it using a thin > wrapper around our array slice syntax. It is literally just ($1)[1:$2]. > > An interesting case