Re: add function argument name to substring and substr

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add function argument name to substring and substr
Date: 2025-03-19 04:04:21
Message-ID: CACJufxH0jqshH6SC97eQ7T=QcSYpbtKMR2=wmds=K2UT9t0tFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.

new patch attached.
now \df substring looks like:
List of functions
Schema | Name | Result data type | Argument
data types | Type
------------+-----------+------------------+--------------------------------------------------+------
pg_catalog | substring | bit | bits bit, start integer
| func
pg_catalog | substring | bit | bits bit, start integer,
count integer | func
pg_catalog | substring | bytea | bytes bytea, start
integer | func
pg_catalog | substring | bytea | bytes bytea, start
integer, count integer | func
pg_catalog | substring | text | string text, pattern text
| func
pg_catalog | substring | text | string text, pattern
text, escape_character text | func
pg_catalog | substring | text | string text, start
integer | func
pg_catalog | substring | text | string text, start
integer, count integer | func

Table 9.10 also have doc entry for substring.
in Table 9.10, i have:
substring ( string text, pattern text ) → text
substring ( string text, pattern text, escape_character text) → text

we can put it into one,
but one is based on POSIX regular expression, another one is based on SQL,
the difference is big, that's why put it into two.

Attachment Content-Type Size
v3-0001-add-argument-name-to-function-substring-and-subst.patch text/x-patch 13.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2025-03-19 04:09:21 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Sungwoo Chang 2025-03-19 03:46:30 Re: like pg_shmem_allocations, but fine-grained for DSM registry ?