Re: [PATCH] Add support for leading/trailing bytea trim()ing

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add support for leading/trailing bytea trim()ing
Date: 2020-12-04 18:44:37
Message-ID: 50a26f18-0275-4843-b960-52890eb59f73@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 4, 2020, at 17:37, Tom Lane wrote:
>No objection in principle, but you need to extend the code added by
>commit 40c24bfef to know about these functions.

Oh, I see, that's a very nice improvement.

I've now added F_LTRIM_BYTEA_BYTEA and F_RTRIM_BYTEA_BYTEA to ruleutils.c accordingly,
and also added regress tests to create_view.sql.

>The grammar in the functions' descr strings seems a bit shaky too.

Not sure what you mean? The grammar is unchanged, since it was already supported,
but the overloaded bytea functions were missing.

I did however notice I forgot to update the description in func.sgml
for the bytea version of trim(). Maybe that's what you meant was shaky?
I've changed the description to read:

- <parameter>bytesremoved</parameter> from the start
- and end of <parameter>bytes</parameter>.
+ <parameter>bytesremoved</parameter> from the start,
+ the end, or both ends of <parameter>bytes</parameter>.
+ (<literal>BOTH</literal> is the default)

New patch attached.

/Joel

Attachment Content-Type Size
leading-trailing-trim-bytea-002.patch application/octet-stream 11.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-12-04 18:51:57 Re: WIP: WAL prefetch (another approach)
Previous Message Alexey Kondratov 2020-12-04 18:40:31 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly