Re: patch: function xmltable

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(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-17 18:07:42
Message-ID: CAFj8pRCJs_jPMUFQunmvoXxchKM+PYy2B7FOO5H857as3MGEQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2017-01-16 23:51 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Given
> https://www.postgresql.org/message-id/20170116210019.
> a3glfwspg5lnfrnm(at)alap3(dot)anarazel(dot)de
> which is going to heavily change how the executor works in this area, I
> am returning this patch to you again. I would like a few rather minor
> changes:
>
> 1. to_xmlstr can be replaced with calls to xmlCharStrdup.
> 2. don't need xml_xmlnodetostr either -- just use xml_xmlnodetoxmltype
> (which returns text*) and extract the cstring from the varlena. It's
> a bit more wasteful in terms of cycles, but I don't think we care.
> If we do care, change the function so that it returns cstring, and
> have the callers that want text wrap it in cstring_to_text.
> 3. have a new perValueCxt memcxt in TableExprState, child of buildercxt,
> and switch to it just before GetValue() (reset it just before
> switching). Then, don't worry about leaks in GetValue. This way,
> the text* conversions et al don't matter.
>
> After that I think we're going to need to get this working on top of
> Andres' changes. Which I'm afraid is going to be rather major surgery,
> but I haven't looked.
>

I'll try to clean xml part first, and then I can reflect the SRF changes. I
am not sure if I understand to all your proposed changes here, I have to
look there.

Regards

Pavel

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-01-17 18:18:02 Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Previous Message Gilles Darold 2017-01-17 18:06:22 Re: Patch to implement pg_current_logfile() function