Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-27 Thread David G. Johnston
On Thursday, June 20, 2024, David G. Johnston wrote: > >> > >> > > As for table 9.16.3 - it is unwieldy already. Lets try and make the >> core syntax shorter, not longer. We already have precedence in the >> subsequent json_table section - give each major clause item a name then >> below the

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-27 Thread Amit Langote
On Thu, Jun 27, 2024 at 9:01 PM Amit Langote wrote: > On Sat, Jun 22, 2024 at 6:39 PM jian he wrote: > > On Fri, Jun 21, 2024 at 8:18 PM Amit Langote > > wrote: > > > > > > >> JSON_VALUE on error, on empty semantics should be the same as > > > >> json_query. > > > >> like: > > > >> [ { ERROR

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-27 Thread Amit Langote
Hi, On Sat, Jun 22, 2024 at 6:39 PM jian he wrote: > On Fri, Jun 21, 2024 at 8:18 PM Amit Langote wrote: > > > > >> JSON_VALUE on error, on empty semantics should be the same as json_query. > > >> like: > > >> [ { ERROR | NULL | EMPTY { [ ARRAY ] | OBJECT } | DEFAULT expression } > > >> ON

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-22 Thread jian he
On Fri, Jun 21, 2024 at 8:18 PM Amit Langote wrote: > > >> JSON_VALUE on error, on empty semantics should be the same as json_query. > >> like: > >> [ { ERROR | NULL | EMPTY { [ ARRAY ] | OBJECT } | DEFAULT expression } > >> ON EMPTY ] > >> [ { ERROR | NULL | EMPTY { [ ARRAY ] | OBJECT } |

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-22 Thread Amit Langote
On Fri, Jun 21, 2024 at 9:18 PM Amit Langote wrote: > On Fri, Jun 21, 2024 at 9:47 AM David G. Johnston > wrote: > > On Thu, Jun 20, 2024 at 9:01 AM jian he wrote: > >> playing around with it. > >> found some minor issues: > >> > >> json_exists allow: DEFAULT expression ON ERROR, which is not

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-21 Thread Amit Langote
On Fri, Jun 21, 2024 at 9:47 AM David G. Johnston wrote: > On Thu, Jun 20, 2024 at 9:01 AM jian he wrote: >> >> On Thu, Jun 20, 2024 at 5:46 PM Amit Langote wrote: >> > >> > On Thu, Jun 20, 2024 at 1:03 AM David G. Johnston >> > wrote: >> > > On Wed, Jun 19, 2024 at 8:29 AM jian he >> > >

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-20 Thread David G. Johnston
On Thu, Jun 20, 2024 at 9:01 AM jian he wrote: > On Thu, Jun 20, 2024 at 5:46 PM Amit Langote > wrote: > > > > On Thu, Jun 20, 2024 at 1:03 AM David G. Johnston > > wrote: > > > On Wed, Jun 19, 2024 at 8:29 AM jian he > wrote: > > >> > > >> On Mon, Jun 17, 2024 at 9:05 PM Chapman Flack >

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-20 Thread jian he
On Thu, Jun 20, 2024 at 5:46 PM Amit Langote wrote: > > On Thu, Jun 20, 2024 at 1:03 AM David G. Johnston > wrote: > > On Wed, Jun 19, 2024 at 8:29 AM jian he wrote: > >> > >> On Mon, Jun 17, 2024 at 9:05 PM Chapman Flack wrote: > >> > > >> > Hi, > >> > > >> > On 06/17/24 02:43, Amit Langote

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-20 Thread Amit Langote
On Thu, Jun 20, 2024 at 1:03 AM David G. Johnston wrote: > On Wed, Jun 19, 2024 at 8:29 AM jian he wrote: >> >> On Mon, Jun 17, 2024 at 9:05 PM Chapman Flack wrote: >> > >> > Hi, >> > >> > On 06/17/24 02:43, Amit Langote wrote: >> > > context_item expression can be a value of >> > > any type

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-19 Thread David G. Johnston
On Wed, Jun 19, 2024 at 8:29 AM jian he wrote: > On Mon, Jun 17, 2024 at 9:05 PM Chapman Flack wrote: > > > > Hi, > > > > On 06/17/24 02:43, Amit Langote wrote: > > > context_item expression can be a value of > > > any type that can be cast to jsonb. This includes types > > > such as char,

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-19 Thread jian he
On Mon, Jun 17, 2024 at 9:05 PM Chapman Flack wrote: > > Hi, > > On 06/17/24 02:43, Amit Langote wrote: > > context_item expression can be a value of > > any type that can be cast to jsonb. This includes types > > such as char, text, bpchar, > > character varying, and bytea (with > > ENCODING

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-17 Thread Chapman Flack
Hi, On 06/17/24 02:43, Amit Langote wrote: > context_item expression can be a value of > any type that can be cast to jsonb. This includes types > such as char, text, bpchar, > character varying, and bytea (with > ENCODING UTF8), as well as any domains over these types. Reading this message in

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-17 Thread jian he
On Mon, Jun 17, 2024 at 2:43 PM Amit Langote wrote: > > Hi, > > On Tue, Jun 4, 2024 at 12:11 AM jian he wrote: > > > > hi > > based on gram.y and function transformJsonValueExpr. > > > > gram.y: > > | JSON_QUERY '(' > > json_value_expr ',' a_expr json_passing_clause_opt > >

Re: SQL/JSON query functions context_item doc entry and type requirement

2024-06-17 Thread Amit Langote
Hi, On Tue, Jun 4, 2024 at 12:11 AM jian he wrote: > > hi > based on gram.y and function transformJsonValueExpr. > > gram.y: > | JSON_QUERY '(' > json_value_expr ',' a_expr json_passing_clause_opt > json_returning_clause_opt > json_wrapper_behavior > json_quotes_clause_opt >

SQL/JSON query functions context_item doc entry and type requirement

2024-06-03 Thread jian he
hi based on gram.y and function transformJsonValueExpr. gram.y: | JSON_QUERY '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt ')' | JSON_EXISTS '(' json_value_expr ',' a_expr