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.96) (envelope-from ) id 1w8fca-000lTK-0t for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 14:35:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8fcZ-00C2yD-0S for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 14:35:39 +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.96) (envelope-from ) id 1w8fcY-00C2y5-1t for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 14:35:39 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8fcW-00000000Mot-3RuG for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 14:35:38 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5a12cd0bd79so2311681e87.2 for ; Fri, 03 Apr 2026 07:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775226933; cv=none; d=google.com; s=arc-20240605; b=aLksUSOwOlyRfzx00X2rDyPlPARo8GDNirHq1G/3VxiVjy8RKaIlnUklRrhbmMlBZ6 YYeX2Dv1nPu7883sHTH5U+SdloVXy5w4ZZULLENErznSunQi7vS4McNmhUj9xhl/yFfU ylTKww5/qnBnSg3HTtfN5kUzeqjVwpXruqbUk/qLmJlmb0qZAadoFUNDtGbnCmCI9c38 WNEo5jdvxCneRw7oiYo1/G0nKstbIkXYXq/L3mLeNSbTAKiKZZ6iZ7TR4TVgwd+dV4BO LVQY1RjMYf387EFTIxnGK/WrzNUVfDVQA+ygE3FFj1QiR+5d7oYrUzgP+3HopqvZyqPk cx9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=zREpEopIxJBpiLIbSvJL8ja5zIVUwmLLiIG7rTJBiNg=; fh=MOEGEtXAaU6x3njLL0zWD0OOxqQ7feV5bSGGDnrzecc=; b=LxzQEKGXJorQ0rtAo3p9xkf603Ckcfo9y3Pd/m/uimeZKO7Kf0DwzbP1tCrJ4+BV+q QXIXzlalxQjxsFFSBVgncSzf3BlA6mnLOPNl/E1bWsdbbHA2Zq6b7qZeNAKad+x6auxp 6Rkl+U0sSBNmGMXfN4CEy5V18xx+fNX2f9gPIF2YMTPr3nbRNUE86hArTCtJ6QvfCkpj fW4yFnM+ihvoXvA3dUEIB2a8OtYVJ3wMQf5rPH8pZvs9k70gFB2pgapJPscR7tvmidWB /fzbJX0VkxSGYtBdwWEqjXD+RfqBSB1A0R3Bsm8+FnaF6nk2d0qUox4CHghBjL8sF/fg 6/Ww==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=f10-com-br.20251104.gappssmtp.com; s=20251104; t=1775226933; x=1775831733; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zREpEopIxJBpiLIbSvJL8ja5zIVUwmLLiIG7rTJBiNg=; b=HWd6nWWyyU0sdoGLcXdV/s7oKOeQ92QRtUKwftvXgo/kYrmcBFVhV3YrfCoeA9obIr a9EwKI97XnbvovtMnYc0WgwiS1GYBZH7oIW8W61RW8zTH9KGAcKKy1GKP95XD4MKcY5q x2Se1OitYmTSdZqFwEgcpAV307xEF+lHWODSDajv8HeMSTI2Xh6DHPtEcDTB9f1WjEKQ 6PrzQNBASJk1m1TCZMkQ8GXvW00eQFmSo4KxrY1oqewKuuYsDGeKzvKFCNZcTxxpasSY sOMRoimZjg2fVbXgvax0cNyVJeIQQ15x6L6vkDPLdSOX2DR/8Dr0SFp0/RK5nKkoUBTm 2XHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775226933; x=1775831733; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zREpEopIxJBpiLIbSvJL8ja5zIVUwmLLiIG7rTJBiNg=; b=T75zL+5tXszilJhSiz99r6kk2Zmu1TY37Bsw3FcS4TqL/A6DlqzrREFj28fcQfjiNy +cpLFFCKii15KBz5QF1SbD7TS8UdaU2/uVRlRcNzgtRsJ1MpjJfvGkrDI6qf6hBfjL5X nyFLuLdd5buVup8MWf+e/rdiaBhxshQbLg7FRNmyl/SWeUcXmfJR8/4K8skJ90sq4cz9 tMPKNSDvHG/SxCzp6ys7PHWAuf/GrLIlf+kaBs4djlFDi5IxHGW7i+Ae6iwBnmlngt8l xzCrRwTzy0sgH6xn6iEgVr6hF5eMNL3bVLhh8JfRLEPMLHxMN7+IDIr/wU7Y1jeFSyuw 2JFQ== X-Forwarded-Encrypted: i=1; AJvYcCUfIGNcbEQkDGr8jTIGiJVjFmDvCHbIkpr7xCtuXTIg3nuSsobe7fgMfVEY8ze3B7h/7p2IHrxgnX98ngHu@lists.postgresql.org X-Gm-Message-State: AOJu0YyOCCAmB8eNtLilKhzNs6O5UES4dcN9KvWhRZsspQavs9q3iT7D r2prtMlAQJq05l4vDd2mNljT3WV8JYNSgzBhweIKJwRkGQeMaDmvkT5mtcLuY4YmraUOiv49dc7 rH70ot+p4mYlEr6c6oR4qTmogi6ILdPtnn/Ymfm1S X-Gm-Gg: AeBDietMg3uzkgfTNPxKEuURcyO/kk2teZnmYIamkN7bTuEYXd4MY+5cuIC65F3KguR mWCiqlRE8shvQdZ2nsb7IvNVg1hWqpU/Rltw0Hhxl+3+TL4zloBzwPDFGqaCMZKl4UKV8gXvN9v G21Co8hsgt3tuZC4+D26RMg37t80jRd6i6rLfLo/aYcuYvJjYcGJP/M0wsZrqcRhpBtvCtqL6UT ntKYG0HdfUG12CprEKwDbdWE6mnOu5QnneEmPCMWxQpTv7Oi01ds8VrFtIkLOXPVHkImwJ8Mfmk DaFGGXkl9hZKa8J4Lw== X-Received: by 2002:a05:6512:6cc:b0:5a1:44d3:7601 with SMTP id 2adb3069b0e04-5a337587230mr1024343e87.20.1775226933280; Fri, 03 Apr 2026 07:35:33 -0700 (PDT) MIME-Version: 1.0 References: <202510210803.3b3vfvygxtjl@alvherre.pgsql> <931F201B-FF38-486E-BDEE-DF9692A01E1D@justatheory.com> <1eb15091-660d-477b-acda-b61d00bc9ffb@dunslane.net> <278cb771-6008-44e5-8eaa-9d4acdb56c79@dunslane.net> <9E9B3C10-7535-4704-A04A-DF5D32C43DBE@justatheory.com> <34758556-D3D0-42C3-9A1B-CBF64336ADBC@justatheory.com> <88a392fd-d732-45a7-bcfc-291258849fbe@dunslane.net> <40bd5c82-639d-41cd-ad85-9cd2dffd0680@dunslane.net> In-Reply-To: From: Marcos Pegoraro Date: Fri, 3 Apr 2026 11:34:57 -0300 X-Gm-Features: AQROBzAR7Re3gU0PmcTOkUjfhffYA4xa1EPt0PpJvGPy34RfaVaCTv3xNQ-HIOU Message-ID: Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part To: Andrew Dunstan Cc: "David E. Wheeler" , Florents Tselai , pgsql-hackers , Chao Li , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Tom Lane , Peter Eisentraut , Robert Haas , Alexander Korotkov , jian he Content-Type: multipart/alternative; boundary="000000000000c112dd064e8f3a8c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c112dd064e8f3a8c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em sex., 3 de abr. de 2026 =C3=A0s 10:36, Andrew Dunstan escreveu: > On second thoughts, I don't think this is a typo. btrim() removes leading > and trailing sequences of any characters in the argument string. > Regression has this, so you are correct. select jsonb_path_query('"zzzytest"', '$.ltrim("xyz")'); jsonb_path_query ------------------ "test" I always thought that only those with exactly the same string would be removed, but thinking char by char, then it makes perfect sense. And it works like string trim functions, so everything's fine. Sorry for the noise. regards Marcos --000000000000c112dd064e8f3a8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Em sex., 3 de abr. = de 2026 =C3=A0s 10:36, Andrew Dunstan <andrew@dunslane.net> escreveu:
= =20 =20 =20

On second thoughts, I don't think this= is a typo. btrim() removes leading and trailing sequences of any characters in the argument string.

Regression has = this, so you are correct.
select jsonb_path_query(= 9;"zzzytest"', '$.ltrim("xyz")');
=C2= =A0jsonb_path_query
------------------
=C2=A0"test"

I always thought= that only those with exactly the same string would be removed, but thinkin= g char by char, then it makes perfect sense.
And it works like string=C2= =A0trim functions, so everything's fine.=C2=A0
S= orry for the noise.

regards
Marcos
--000000000000c112dd064e8f3a8c--