Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v8KSO-00GPgL-Iw for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Oct 2025 15:27:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v8KSK-006W8L-Uk for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Oct 2025 15:27:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v8KSK-006W8D-LQ for pgsql-hackers@lists.postgresql.org; Mon, 13 Oct 2025 15:27:25 +0000 Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v8KSJ-001YFe-35 for pgsql-hackers@postgresql.org; Mon, 13 Oct 2025 15:27:24 +0000 Received: by mail-vk1-xa34.google.com with SMTP id 71dfb90a1353d-54bc6f33513so2858265e0c.2 for ; Mon, 13 Oct 2025 08:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760369243; x=1760974043; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3iFOvpsyEcfWO1YXMgA/LGkqY7Fu+RyzwMyG5nDpK1g=; b=EHNOTUe3s7DCr6f2n2dbTrROtkNy+QJ5AW9XRLvT35pA2W9AQr+ir6BJgrajjw1lX2 v8by7//3xFtFL4niCuNYxP9G2prn+ZkDIrb7VSZzzRa6Rbe9JQ2Uhyg8nGj3NNnFKShs f3CxJZsSg6TyU3QrCoZiBJfglhLHn80F6CSAtSO24Uj4hSLGLwJkhA1iaTMz/5Swab+h B8rjT0o8zwlUqh9bfzlB5vjvlDKBCTs7hSncz4/qC0o4XtKUk5g7laJBIHr0mzC+Rj85 PTaoPoQLYKNTrPy7WoGghLwbnQoz8yIUbx63782LJcnHLpLPVDZyGugqelou+XG9bZGu /x3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760369243; x=1760974043; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3iFOvpsyEcfWO1YXMgA/LGkqY7Fu+RyzwMyG5nDpK1g=; b=dcEikZvujBXlwR1ME3OwAQXTYkSYPQw31PWPryMAZ417T2qk+R/Zbe/p9vgYyrPU0j b9XkuSDlJBCQcfNeY0mNyNDu6Cqoy/kCJ3IsyyUJGuOz45us0ahbsK6ltx8cU05I++0w 0XMKz0V/s0qrt/CXewEFg8J7JYPXEpypJkyjo1uJMPDd8puxxwecbOYQ/U8HLTylG0hz bGDEJPMl5QyQSmApsZp//Q1aVg87w2SjObtNu7dkme4BNruFHQTrxonw+uD0l1XTVFEf cOS033C8+KQF69Fvhb/FdvnyOtDiKADClyeJIPRfNhAI9byQ4PyvQxf0cMx1GdA5MfYf O++A== X-Forwarded-Encrypted: i=1; AJvYcCUuzx9rr71SKxpkvzosmN/TzdCkRsBCc6vKrATq/7G7V4brE4tW/f/Aj5Tp2OztSvq1KFq1sHEa8bx4Tduk@postgresql.org X-Gm-Message-State: AOJu0Yy1XzxrVCNJnAgTJutTBPBKJ0qR+I4YseyX+peikgIOs2UmptOU f2qAi2Glx+NSsWghT3EWax4745GLCAPHZVd5q2DIrG970XWWmVjBru9czUwKKzCwEJUrKKN4Lz5 FgZcwp4UZeFohrXSGJcY4oX1QJUBVePU= X-Gm-Gg: ASbGncutQQY+DL9c6+HYwfohDT2eBrSX+4NHxQ6IDgcICJ3VWimI4lZoUnVjlECkhSl J5yWAHWICVZR1vcIaB/LylmIL3vXgeIcvrlMv9eFgAiHd4OU09X/d/ewVMFLrNHmefdig5HTVsp BFYqz83iWTtAmQflCindy9ANjxZv+axlNE0A6rqrA+fOmnln83kDO5jhoKtSwZsveG+vHRBpJbS sR6H1n2yfBZNbZS/dGWQLhmk38zmQrUhQmxMSgZyzLqSMcatnmfmPEgppfqhLofJpOVlOKebLf7 NEfwwsGTnInk5dDovnGr4Gb82nxAV/FSdM0/+b/piNVWi+l/ayXOk6HbvHZjFjhLUX+8nltHAFc wQhBu2SkXxGw2RLhy3DIMLdD/zaBJJZDL+RE1hlcOHYnDFiRxJyIAJjptoRpMgpF4 X-Google-Smtp-Source: AGHT+IH92hLbqaRU4y47BlB2TjOSuX6LjIgS4vY45u12iUkTqtMVY/WF9NMK7yoUTzEbLKrcT/F7h5sqQzj/gBkNoc4= X-Received: by 2002:a05:6122:319f:b0:54a:9cff:6fe7 with SMTP id 71dfb90a1353d-554b8aabadfmr8755361e0c.4.1760369242964; Mon, 13 Oct 2025 08:27:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: jian he Date: Mon, 13 Oct 2025 23:26:46 +0800 X-Gm-Features: AS18NWDuT5w7zjUTlSj2j7IW9-2G_2G1_p-zoSly-ikOwLoPYDe7QDiK6QpMar0 Message-ID: Subject: Re: add function argument name to substring and substr To: Andrew Dunstan Cc: "David G. Johnston" , Marcos Pegoraro , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 13, 2025 at 10:58=E2=80=AFPM Andrew Dunstan wrote: > > I'm late to the party on this, but I wonder if it wouldn't be better to > use a type-neutral parameter name here, like "source", which could cover > all these cases, instead of "string", "bytes", etc. > \df *regexp* psql output generally begins with "string text, pattern text" that's because of commit 580f872. in that commit, discussion, https://www.postgresql.org/message-id/CACJufxG3NFKKsh6x4fRLv8h3V-HvN4W5dA%3= DzNKMxsNcDwOKang%40mail.gmail.com, in that first patch, i did tried to use "source" in some cases, then I foun= d out if you changed to "source" then all the documentation also needs to be changed. so I stuck to "string" in commit 580f872. Here, for the functions substr and substring, I followed the precedent set = by the regex function using the term "string". sure, we can change it to "source" if that's what people want.