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 1taU7V-002Di6-6k for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jan 2025 06:21:45 +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 1taU7U-00CXLe-9d for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jan 2025 06:21:44 +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 1taU7U-00CXLT-0i for pgsql-hackers@lists.postgresql.org; Wed, 22 Jan 2025 06:21:44 +0000 Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1taU7R-000raP-2p for pgsql-hackers@postgresql.org; Wed, 22 Jan 2025 06:21:43 +0000 Received: by mail-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-51619b06a1cso3517798e0c.3 for ; Tue, 21 Jan 2025 22:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737526901; x=1738131701; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=i7PJFtHbItXwgKBXyBNFJpFWDMQ9w1njPHRGu1cWPOo=; b=jV4CDnRQE/NpNgc0ntjnRc4OEmLQkJwH8vopnxSCBqL1jmXXbjQBsRWAauFtnfyXqq zBMHdATvowl5tmbdQPT0YvoFGW1WZp6gzTNnJ3Z8WjliJSVI+1YPya46p1Oof2EemoXV kxBze2S24HvOT1X7gHJSvnnRyuvv3GmT/dFntaULl2Jza1tbn4NA2TQbbLDhedISmLX7 uE5i3bljr0HepU/w1V/D7SDaYQMkNzZN8vXQVFjUzVxV+PFdq5eYWnGMSPW3j1hMgkhy AooRKNM5h3RA/uH/2vHEF6htB4w+Q/pLf/ss7vqRV3W5jrREhV3+SxHvk5ZWkj96bcW7 f5NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737526901; x=1738131701; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=i7PJFtHbItXwgKBXyBNFJpFWDMQ9w1njPHRGu1cWPOo=; b=qFIvwQjqDeFK321yV6sfxuSTGjTNjCZe0/W3mPGC8vK0JKIMtcCy6sxcO+9UFHxdiG 3k8LLP5AQrz+wjL+8SMNztQZlNe/iuD7bb4IK2xHlmosbJs/NPkEGRgZsJcQyOmW/1Vt oC14fZ+dGd0qELvjWQxwYal9TAHxQ9AXN90qt2Vmyeh+uGsDu6qxIsqI7MdQlMf44WDT IXky0xG3VSCsC6ZyoI0OlRulB8N6CWtSr7U8qylcerAYq3CUOL34X+S8fsHwnGJ/6HRV XArCq+PP+JGMy2EurM+q2Ljq7aW7nt4RnJEINg4cjpjUB33DdYBgFbgR3iOTa2X10EM4 pb3A== X-Gm-Message-State: AOJu0YzdnK44TAweP/ZM5xCKdGnqbNLka/jXr3xcc0Zho/659QoxRrzp /reQjO92egbXwJ53osRdKfjXXoTp2EY5HA2EtLd7r7rxqBrK5F6GXFvBZY1V4NtsqRZCTtHDtGw UC9EeNSH9CjUP7K4E3fczr1+tARqRB3QKd2FqRw== X-Gm-Gg: ASbGnctPz0TmGtPAMhAwKxQ+slExrXAig07Ae+s/NB2zrbW2dnNaf5It/eAJXdFO9XX TM0haaDf21Xn6EBTvkU2KWjCdvPijk7cP+oMHCG7O5aqE0yLEXDD7hKpwcCKE3KNAKD9fBQpN6g rJcw1w X-Google-Smtp-Source: AGHT+IE1XtvoJlkAlcu88Y6MkIhRQXOjIYdLNHhrel/aGdtsvDngXZ6V1BDzmgkcUEXpYwWTVfsabokTEwxzma9BrIE= X-Received: by 2002:a05:6122:488a:b0:518:79f2:9345 with SMTP id 71dfb90a1353d-51d5a8c80dbmr18437746e0c.4.1737526901331; Tue, 21 Jan 2025 22:21:41 -0800 (PST) MIME-Version: 1.0 From: jian he Date: Wed, 22 Jan 2025 14:21:05 +0800 X-Gm-Features: AbW1kvYRCEq_WhE6XmgNafNMVaq0o9dYnTnkhtHhxvMUIaoieoFG9jjV10-m7fY Message-ID: Subject: add function argument name to substring and substr To: PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. attached patch add function argument name to function substring and substr you can see the visual changes. mater behavior: \df substring List of functions Schema | Name | Result data type | Argument data types | Type ------------+-----------+------------------+-------------------------+------ pg_catalog | substring | bit | bit, integer | func pg_catalog | substring | bit | bit, integer, integer | func pg_catalog | substring | bytea | bytea, integer | func pg_catalog | substring | bytea | bytea, integer, integer | func pg_catalog | substring | text | text, integer | func pg_catalog | substring | text | text, integer, integer | func pg_catalog | substring | text | text, text | func pg_catalog | substring | text | text, text, text | func with patch 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 I did the same change to the function substr. since 9.7.2. SIMILAR TO Regular Expressions we use substring(string, pattern, escape-character) so i refactor the substring function argument name to substring(string text, pattern text, escape_character text). we can make it as ``substring(string text, pattern text, escape text).`` then in 9.7.2, we need to change the substring synopsis section. one thing I am not sure is about 9.4. String Functions and Operators Table 9.9. SQL String Functions and Operators. Do we need entries for substring related functions? current signature substring ( string text [ FROM start integer ] [ FOR count integer ] ) is kind of different from substring(string text, start integer, count integer). since the previous one can allow keywords "FROM", "FOR", the latter one won't.