Re: Error-safe user functions

From: Amul Sul <sulamul(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Joe Conway <mail(at)joeconway(dot)com>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error-safe user functions
Date: 2022-12-14 12:35:02
Message-ID: CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 13, 2022 at 6:03 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:
>
> On Mon, Dec 12, 2022 at 12:00 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > > Maybe as we work through the remaining input functions (there are about
> > > 60 core candidates left on my list) we should mark them with a comment
> > > if no adjustment is needed.
> >
> > I did a quick pass through them last night. Assuming that we don't
> > need to touch the unimplemented input functions (eg for pseudotypes),
> > I count these core functions as still needing work:
> >
> > aclitemin
> > bit_in
> > box_in
> > bpcharin
> > byteain
> > cash_in
> > cidin
> > cidr_in
> > circle_in
> > inet_in
> > int2vectorin
> > jsonpath_in
> > line_in
> > lseg_in
> > macaddr8_in
> > macaddr_in
>
> Attaching patches changing these functions except bpcharin,
> byteain, jsonpath_in, and cidin. I am continuing work on the next
> items below:
>
> > multirange_in
> > namein
> > oidin
> > oidvectorin
> > path_in
> > pg_lsn_in
> > pg_snapshot_in
> > point_in
> > poly_in
> > range_in
> > regclassin
> > regcollationin
> > regconfigin
> > regdictionaryin
> > regnamespacein
> > regoperatorin
> > regoperin
> > regprocedurein
> > regprocin
> > regrolein
> > regtypein
> > tidin
> > tsqueryin
> > tsvectorin
> > uuid_in
> > varbit_in
> > varcharin
> > xid8in
> > xidin

Attaching a complete set of the patches changing function till this
except bpcharin, byteain jsonpath_in that Andrew is planning to look
in. I have skipped reg* functions.
multirange_in and range_in changes are a bit complicated and big --
planning to resume work on that and the rest of the items in the list
in the last week of this month, thanks.

> > xml_in
> >
> > and these contrib functions:
> >
> > hstore:
> > hstore_in
> > intarray:
> > bqarr_in
> > isn:
> > ean13_in
> > isbn_in
> > ismn_in
> > issn_in
> > upc_in
> > ltree:
> > ltree_in
> > lquery_in
> > ltxtq_in
> > seg:
> > seg_in
> >
> > Maybe we should have a conversation about which of these are
> > highest priority to get to a credible feature. We clearly need
> > to fix the remaining SQL-spec types (varchar and bpchar, mainly).
> > At the other extreme, likely nobody would weep if we never fixed
> > int2vectorin, for instance.
> >
> > I'm a little concerned about the cost-benefit of fixing the reg* types.
> > The ones that accept type names actually use the core grammar to parse
> > those. Now, we probably could fix the grammar to be non-throwing, but
> > it'd be very invasive and I'm not sure about the performance impact.
> > It might be best to content ourselves with soft reporting of lookup
> > failures, as opposed to syntax problems.
> >
>

Regards,
Amul

Attachment Content-Type Size
v1-0025-Change-varbit_in-to-allow-non-throw-error-reporti.patch application/x-patch 3.6 KB
v1-0021-Change-point_in-to-allow-non-throw-error-reportin.patch application/x-patch 2.1 KB
v1-0022-Change-poly_in-to-allow-non-throw-error-reporting.patch application/x-patch 3.4 KB
v1-0023-Change-tidin-to-allow-non-throw-error-reporting.patch application/x-patch 3.5 KB
v1-0024-Change-uuid_in-to-allow-non-throw-error-reporting.patch application/x-patch 2.9 KB
v1-0020-Change-pg_snapshot_in-to-allow-non-throw-error-re.patch application/x-patch 2.6 KB
v1-0018-Change-pg_mcv_list_in-to-allow-non-throw-error-re.patch application/x-patch 2.2 KB
v1-0017-Change-pg_lsn_in-to-allow-non-throw-error-reporti.patch application/x-patch 2.1 KB
v1-0019-Change-pg_ndistinct_in-to-allow-non-throw-error-r.patch application/x-patch 2.1 KB
v1-0016-Change-path_in-to-allow-non-throw-error-reporting.patch application/x-patch 3.8 KB
v1-0015-Change-oidin-and-oidvectorin-to-allow-non-throw-e.patch application/x-patch 6.2 KB
v1-0013-Change-macaddr8_in-to-allow-non-throw-error-repor.patch application/x-patch 5.9 KB
v1-0012-Change-lseg_in-to-allow-non-throw-error-reporting.patch application/x-patch 2.2 KB
v1-0014-Change-macaddr_in-to-allow-non-throw-error-report.patch application/x-patch 3.2 KB
v1-0011-Change-line_in-to-allow-non-throw-error-reporting.patch application/x-patch 20.0 KB
v1-0010-Change-int2vectorin-to-allow-non-throw-error-repo.patch application/x-patch 3.5 KB
v1-0009-Change-gtsvectorin-to-allow-non-throw-error-repor.patch application/x-patch 2.1 KB
v1-0008-Change-circle_in-to-allow-non-throw-error-reporti.patch application/x-patch 5.3 KB
v1-0007-Change-cidr_in-and-inet_in-to-allow-non-throw-err.patch application/x-patch 4.4 KB
v1-0006-Change-money_in-to-allow-non-throw-error-reportin.patch application/x-patch 4.1 KB
v1-0005-Change-brin_minmax_multi_summary_in-to-allow-non-.patch application/x-patch 2.4 KB
v1-0004-Change-brin_bloom_summary_in-to-allow-non-throw-e.patch application/x-patch 2.3 KB
v1-0003-Change-box_in-to-allow-non-throw-error-reporting.patch application/x-patch 9.0 KB
v1-0002-Change-bit_in-to-allow-non-throw-error-reporting.patch application/x-patch 4.0 KB
v1-0001-Change-aclitemin-to-allow-non-throw-error-reporti.patch application/x-patch 5.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2022-12-14 13:05:15 Re: Minimal logical decoding on standbys
Previous Message Jose Arthur Benetasso Villanova 2022-12-14 12:18:44 Re: Amcheck verification of GiST and GIN