Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozQSZ-0004KJ-RB for pgsql-bugs@arkaria.postgresql.org; Sun, 27 Nov 2022 22:49:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozQRZ-0000hr-Hw for pgsql-bugs@arkaria.postgresql.org; Sun, 27 Nov 2022 22:48:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozQRY-0000hE-Ud for pgsql-bugs@lists.postgresql.org; Sun, 27 Nov 2022 22:48:13 +0000 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozQRU-0008IY-I7 for pgsql-bugs@lists.postgresql.org; Sun, 27 Nov 2022 22:48:10 +0000 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id AD94816FC0C; Sun, 27 Nov 2022 17:48:06 -0500 (EST) (envelope-from david@justatheory.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; s=sasl; bh=jVbIYXS5UzIgx48YWoss5UMkjh 2nmxqqvbf57d/TQBI=; b=qgAnNsqEtV7No1An6KVk/FFGylBqT5+wPhbMB/Zcpp Ksgq0Xu+EVJ+FNkSQCuHG0BcJP0LydgRxWL/dW/Gp4bgd8qv3wcnTW5pSE2GUDgZ sNHfCfAOmRMK7dQTZXQWFtFk5imnDMM00URWXZ5xwz1LBCuRAIEnwzGaD/2CqSeP Y= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id A4E5116FC0B; Sun, 27 Nov 2022 17:48:06 -0500 (EST) (envelope-from david@justatheory.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=justatheory.com; h=content-type:mime-version:subject:from:in-reply-to:date:cc:message-id:references:to; s=mesmtp; bh=jVbIYXS5UzIgx48YWoss5UMkjh2nmxqqvbf57d/TQBI=; b=v44PavU1vriR8d4+sHdqRwJoztLFCGmVG+MlScY0Swf+cnH/wmnxV6lqYjKD5ybW0UGhUAaxRiUUsL1qPZfAzSSnEYWQSkWM2e5Uyba1bafjMEx8Efs1QJ331Yc1LwWXseXoqOOKpPjYy7ykgCzOaEzMTsCY0ngDTaYKSrB0mAc= Received: from smtpclient.apple (unknown [158.222.197.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 6AF1116FC0A; Sun, 27 Nov 2022 17:48:05 -0500 (EST) (envelope-from david@justatheory.com) Content-Type: multipart/signed; boundary="Apple-Mail=_A2E13095-AC84-44D9-90F3-E84D64597A7D"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored From: "David E. Wheeler" In-Reply-To: <1DBB0108-3DB1-43BF-BA5A-DCF64743D895@justatheory.com> Date: Sun, 27 Nov 2022 17:47:53 -0500 Cc: "David G. Johnston" , pgsql-bugs@lists.postgresql.org Message-Id: <8B76CFDC-830C-4DF0-9958-CAED05E40133@justatheory.com> References: <17694-2f7d9576ae277d64@postgresql.org> <7B406A27-7142-4F6D-976A-207B4487C7C3@justatheory.com> <9CDD0519-0ABD-4E2F-AE2D-7B03B7A60738@justatheory.com> <1DBB0108-3DB1-43BF-BA5A-DCF64743D895@justatheory.com> To: "David E. Wheeler" X-Mailer: Apple Mail (2.3731.200.110.1.12) X-Pobox-Relay-ID: 8E608DF8-6EA5-11ED-B5A6-2AEEC5D8090B-76319746!pb-smtp1.pobox.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_A2E13095-AC84-44D9-90F3-E84D64597A7D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Nov 24, 2022, at 12:55, David E. Wheeler = wrote: > Yeah, this doesn=E2=80=99t seem right, either: >=20 > david=3D# select jsonb_path_exists('{"foo": {"bar": true}}', '$path', = '{"path": "$.foo.bax"}'); > jsonb_path_exists > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94 > t david=3D# select '{}' @? '$.emails.work =3D=3D "hi@home.com"'; ?column? ---------- t Works properly with `@@`, though: david=3D# select '{}' @@ '$.emails.work =3D=3D "hi@home.com"'; ?column? ---------- f Have to admit I find this pretty weird. I see that the docs say that = this Postgres-specific boolean predicate syntax is required for @@, but = it doesn=E2=80=99t say it doesn=E2=80=99t apply to @? But the `?()` = filter syntax works as expected with @?: david=3D# select '{}' @? '$.emails.work ?(@ =3D=3D "hi@home.com")'; ?column? ---------- f Wondering if I should avoid `@?`. Frankly I don=E2=80=99t understand the = difference between `@@` and `@?`. Best, David --Apple-Mail=_A2E13095-AC84-44D9-90F3-E84D64597A7D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd+KfmbOQis6ZycGGkt9idPjIgfEFAmOD6RkACgkQkt9idPjI gfFjfw/7BdzObtE/w0M74A+586cOaK4+xkBKrFLRMjlfIXIguxYqAxRn7vFMsWxK Kzgz5p3kq1j+1m3PcKxK6TcW0OF+i4wu0qK9A745UMTVTHn91ecnodATTc8IcqdN lGCSXs1d+J8qIyrqRcxRckp0YoCIkTjK8Gb+ik8ZvUQpa6kWgKI6+Lye4AWcj/VC hGae5Yr6ZFIHYx3yc3VQrwbD1lhQ45JCGPJQRli/wW2yoeYoTfb4svO5O4RG59Xo RBJeGKymXnKXsqQ9z0gVfrdbeoJQjRUu1oEA+GJBgR0jNGwpeO6FgBTXjgU1vOmN PMqdj3DLXni/YJOee5XR/CWhGPmRYi8N42Ac+jzZsTpjjc+LNxYpUmM77Nh1jtcz hy5SOdz0/uAFlcxhXG5OVXz04/eGgYJQPFwV7qtB0iUryS0NgKKNxMCpeDr+25Cv z6LIIy3dIeyRd9+yHUeGzVJispGoDuOhvHA+ihpM2Mb6voh81mDW68CPDxwwiEn3 CppLkI5a9MjYjuEFFtumRMCorS9qrdQRErKL4H7iVZYbIfsFs5lYllycRsUmN7Ad hVVQsuNBISSx3sseHm2+/lj961a2vygAZP8vQy5MHgJ0YNfeUL7tsTA8Mr2qW7Zt wcL90qz3NBFXfB2Y+28hNzYzt5oF0piRPr/T0kTLAk9vKl9aOZY= =uKiW -----END PGP SIGNATURE----- --Apple-Mail=_A2E13095-AC84-44D9-90F3-E84D64597A7D--