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 1rLAch-006TD0-FT for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2024 23:26:07 +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 1rLAcf-008r1w-Uq for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2024 23:26:05 +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 1rLAcf-008r1o-La for pgsql-hackers@lists.postgresql.org; Wed, 03 Jan 2024 23:26:05 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rLAcd-00Dbl2-5v for pgsql-hackers@lists.postgresql.org; Wed, 03 Jan 2024 23:26:04 +0000 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6dc1fe0889fso3459448a34.3 for ; Wed, 03 Jan 2024 15:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704324362; x=1704929162; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oMN0iEFAWH6T/KBBs/AGtjuUHxWu/ot/94VArRyLARo=; b=HLzVaUpf6V4V64j4jJxSFDmZTS1F7EKv1A573w9YX24EZ734++RXCWAJdojA63VO5i CbL9W2dlZGmThbZh9rHgWOA6uMsFEJK7bx/hP64T3f/nXcXU5TJ/p6Xz8QF5d9nJrHw4 jCxedN92TINDQIV3g33fzPnSj2S7oknrVG7NHNrN50XJTpIA3h61fSe6PQ3MC05lCOZx WHZIKxnU0BjPbFJcrU3Me/JAIAHkIwAzVj3B2XPfIwMlwTzFDhZcsbMynaPF/fijN1Ql 5qtJ5RkVrKurhYuoMWeYyTc0wiHltTAff/o9d7EJK7AZYX+144EIOzb9cgYSF1QFC6JD naqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704324362; x=1704929162; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oMN0iEFAWH6T/KBBs/AGtjuUHxWu/ot/94VArRyLARo=; b=Jc1HXhEPAn97O4/gB1zc4IUWyKD9HaCNQ0QDk22DHm0JFSmIKjV1JNV3Qs8N7gzs30 2JW7edo1DXS1Oabo311YrPUf6D5zt381XCXb4j7YJYjOF5pEKPe3wS1rdflcQkuyTU9e L1dK+T5Y8ReygDY+Mv3knk+xrDFuZRQJsqQgsSe1p2JSfRhpdBKUXU/n6u59wGgopozd B82vW0TQDxrxR/V/IfBQKRaTDBYa+hszlrgy7iUhNhHpKvdRXB+028noT3+kEH+WzK74 h0Z//2LaS9+TzWTrfuhkhP2x9kMfqutLVC7TbKegpPAykwYDNbIxMkuIkaBqQtv+C0ct AiKw== X-Gm-Message-State: AOJu0YwjTCX2h5/hBc5Vkv7m9/IiZm5wFwvpu+nqzP3HyCjme29td58M gfcZ65o3gEsIbNUHlhDESg== X-Google-Smtp-Source: AGHT+IE2dA9COv49ttflfeg+7p19fizpH5h1mHG9Gz6wE9ZC7dhrioaO3RsqStGKwYjC6UD3G+c1hA== X-Received: by 2002:a05:6870:9a23:b0:203:c5ca:5333 with SMTP id fo35-20020a0568709a2300b00203c5ca5333mr24708458oab.41.1704324362441; Wed, 03 Jan 2024 15:26:02 -0800 (PST) Received: from [192.168.2.9] (070-113-014-216.res.spectrum.com. [70.113.14.216]) by smtp.gmail.com with ESMTPSA id ns7-20020a056870ac8700b001fb3143cc0bsm6216544oab.44.2024.01.03.15.26.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jan 2024 15:26:02 -0800 (PST) Message-ID: <75129a34-14da-48aa-9906-42062fe78664@gmail.com> Date: Wed, 3 Jan 2024 17:25:59 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: add function argument names to regex* functions. Content-Language: en-US To: Dian Fay , jian he , Peter Eisentraut Cc: PostgreSQL Hackers References: <0eb3a5d7-75d8-4da5-9c88-a93deccdaa03@gmail.com> From: Jim Nasby In-Reply-To: Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk
On 1/3/24 5:05 PM, Dian Fay wrote:
Another possibility is `index`, which is relatively short and not a
reserved keyword ^1. `position` is not as precise but would avoid the
conceptual overloading of ordinary indices.
I'm not a fan of "index" since that leaves the question of
whether it's 0 or 1 based. "Position" is a bit better, but I think
Jian's suggestion of "occurance" is best.
We do have precedent for one-based `index` in Postgres: array types are
1-indexed by default! "Occurrence" removes that ambiguity but it's long
and easy to misspell (I looked it up after typing it just now and it
_still_ feels off).

How's "instance"?

Presumably someone referencing arguments by name would have just looked up the names via \df or whatever, so presumably misspelling wouldn't be a big issue. But I think "instance" is OK as well.

-- 
Jim Nasby, Data Architect, Austin TX