Re: TRIM_ARRAY
Dian Fay <dian.m.fay@gmail.com>
From: "Dian M Fay" <dian.m.fay@gmail.com>
To: "Vik Fearing" <vik@postgresfriends.org>,
<pgsql-hackers@lists.postgresql.org>
Cc: "Vik Fearing" <vikreykja@gmail.com>
Date: 2021-03-02T00:02:50Z
Lists: pgsql-hackers
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 unnest in the source code and > also my compiled html. Can you say more about where you're seeing the > wrong order? I applied the patch to the latest commit, ffd3944ab9. Table 9.52 is ordered: array_to_string array_upper trim_array cardinality unnest > The problem here is that postgres needs to know what the return > type is and it can only determine that from the input. > > If you give the function a typed null, it returns null as expected. > > > The new status of this patch is: Waiting on Author > > I put it back to Needs Review without a new patch because I don't know > what I would change. 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. I've got no objections other than the docs having been displaced.
Commits
-
Add trim_array() function.
- 0a687c8f103d 14.0 landed