Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David E. Wheeler
On Jul 8, 2024, at 12:17, David G. Johnston wrote: > We created a data type named: jsonpath. Does the standard actually have that > data type and defined parsing behavior or does it just have functions where > one of the inputs is text whose contents are a path expression? Ah, got it. D

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David G. Johnston
On Mon, Jul 8, 2024 at 9:12 AM David E. Wheeler wrote: > On Jul 8, 2024, at 12:05, David G. Johnston > wrote: > > > Does the standard even have a separate type here or is that our > implementation detail invention? > > Sorry, separate type for what? > > We created a data type named: jsonpath. D

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David E. Wheeler
On Jul 8, 2024, at 12:05, David G. Johnston wrote: > If we go down this path wouldn't the correct framing be: do not allow > accessors after scalars ? The same argument applies to false/"john" and > other scalar types since by definition none of them have subcomponents to be > accessed. Yes

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David G. Johnston
On Mon, Jul 8, 2024 at 8:27 AM David E. Wheeler wrote: > Hi, following up on some old threads. > > > On Apr 10, 2024, at 16:44, David E. Wheeler > wrote: > > > > That makes sense, thanks. It’s just a little odd to me that the > resulting path isn’t a query at all. To Erik’s point: what path can

Re: ❓ JSON Path Dot Precedence

2024-07-08 Thread David E. Wheeler
Hi, following up on some old threads. > On Apr 10, 2024, at 16:44, David E. Wheeler wrote: > > That makes sense, thanks. It’s just a little odd to me that the resulting > path isn’t a query at all. To Erik’s point: what path can `'0x2.p10` even > select? I’m wondering whether the jsonpath par

Re: ❓ JSON Path Dot Precedence

2024-04-10 Thread David E. Wheeler
On Apr 10, 2024, at 10:29, Peter Eisentraut wrote: > So the whole thing is > > > > The syntax of and is then punted to > ECMAScript 5.1. > > 0x2 is a HexIntegerLiteral. (There can be no dots in that.) > > p10 is an Identifier. > > So I think this is all correct. That makes sense, tha

Re: ❓ JSON Path Dot Precedence

2024-04-10 Thread Peter Eisentraut
On 07.04.24 18:13, David E. Wheeler wrote: Hello Hackers, A question about the behavior of the JSON Path parser. The docs[1] have this to say about numbers: Numeric literals in SQL/JSON path expressions follow JavaScript rules, which are different from both SQL and JSON in some minor detai

Re: ❓ JSON Path Dot Precedence

2024-04-07 Thread David E. Wheeler
On Apr 7, 2024, at 15:46, Erik Wienhold wrote: > I guess jsonpath assumes that hex, octal, and binary literals are > integers. So there's no ambiguity about any fractional part that might > follow. Yeah, that’s what the comment in the flex file says: https://github.com/postgres/postgres/blob/b

Re: ❓ JSON Path Dot Precedence

2024-04-07 Thread Erik Wienhold
On 2024-04-07 18:13 +0200, David E. Wheeler wrote: > A question about the behavior of the JSON Path parser. The docs[1] > have this to say about numbers: > > > Numeric literals in SQL/JSON path expressions follow JavaScript > > rules, which are different from both SQL and JSON in some minor > >

❓ JSON Path Dot Precedence

2024-04-07 Thread David E. Wheeler
Hello Hackers, A question about the behavior of the JSON Path parser. The docs[1] have this to say about numbers: > Numeric literals in SQL/JSON path expressions follow JavaScript rules, which > are different from both SQL and JSON in some minor details. For example, > SQL/JSON path allows .1