Re: [HACKERS] patch: function xmltable

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] patch: function xmltable
Дата
Msg-id CAFj8pRA2UCwquoqxx38QFLMPxDPT=h9nNFq02fYaEVqh=-RJNQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] patch: function xmltable  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [HACKERS] patch: function xmltable  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hi

2017-01-13 21:32 GMT+01:00 Alvaro Herrera <alvherre@2ndquadrant.com>:
Pavel Stehule wrote:
>
> I used your proposed way based on Restarget

Thanks.  Some more tweaking to go yet before I consider this
committable, but it's much better now.  Here's v28.  I changed a few
things:

- make expression evaluation code more orthodox:
  1. avoid PG_TRY, use a ExprContext shutdown callback instead
  2. use a "Fast" evaluator, for calls past the first one
  3. don't look up fmgrinfos until execution time
  4. don't duplicate get_expr_result_type
- make parser accept DEFAULT namespace. Only xml implementation barfs.
  (this means we lost the errposition pointer, but I don't really
   care. We could fix it if we cared)
- clean up parse analysis code a little bit
- move decls/struct defs to better locations in source code
- remove leftover "namespaces" in TableExprState
- pgindent the whole mess.


I checked the changes and looks correct - although for some I had not courage :) - like dynamic change of exprstate->evalfunc

I fixed test, and append forgotten header file


 
I don't like the xml.c code and the "evalcols" flag.  That's next on my
list to fix.

You need some flag to specify if column paths are valid or not.  


I don't think to_xmlstr() is necessary, considering xml_text2xmlChar.
We could just apply a cast of the source cstring to xmlChar.

is it safe? For one byte encodings?

Regards

Pavel
 

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Gilles Darold
Дата:
Сообщение: Re: [HACKERS] Patch to implement pg_current_logfile() function
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctlstart without --wait