Re: How does pg parse 'select '(1,2)''

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: How does pg parse 'select '(1,2)''
Дата
Msg-id 20230807.145442.813357160212428987.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на How does pg parse 'select '(1,2)''  (jacktby jacktby <jacktby@gmail.com>)
Список pgsql-general
At Sat, 5 Aug 2023 21:46:33 +0800, jacktby jacktby <jacktby@gmail.com> wrote in 
> I’m trying to add new grammar for my application. So I’m do research on gram.y.
> I think it will make the '(1,2)' as " '(' a_expr ')' "; but I can’t find out something like
> " a_expr ',' a_expr “, can you give me the details?

If you are trying literally "SELECT (1, 2)", I think that the parser
comes to the terminating a_expr through the following path.

<omitted>
simple_select: SELECT .. opt_target_list ...
opt_target_list: target_list
target_list: target_el | target list '.' target_el
target_el: a_expr
a_expr: c_expr
c_expr: implicit_row
implicit_row: '(' expr_list ',' a_expr ')'
expr_list: a_expr | expr_list ',' a_expr

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Dropping all tables in a database
Следующее
От: KK CHN
Дата:
Сообщение: Re: Backup Copy of a Production server.