Skip site navigation (1) Skip section navigation (2)

Re: patch: function xmltable

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>,PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: function xmltable
Date: 2017-01-13 20:32:08
Message-ID: 20170113203208.wtjnjgubhjpjulrq@alvherre.pgsql (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
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

- 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 don't like the xml.c code and the "evalcols" flag.  That's next on my
list to fix.

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

Álvaro Herrera      
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment: xmltable-28.patch
Description: text/plain (160.8 KB)

In response to


pgsql-hackers by date

Next:From: Pavel StehuleDate: 2017-01-13 20:45:04
Subject: Re: Packages: Again
Previous:From: Alvaro HerreraDate: 2017-01-13 20:09:57
Subject: Re: [COMMITTERS] pgsql: Fix a bug in how we generate partition constraints.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group