Re: [HACKERS] patch: function xmltable - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: [HACKERS] patch: function xmltable
Date
Msg-id CAFj8pRBTmHsJ-mU4n75JhuS8-HK1YyDPYF6LQbPd3D1fDwNKXw@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] patch: function xmltable  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi

2017-01-11 22:53 GMT+01:00 Alvaro Herrera <alvherre@2ndquadrant.com>:
Alvaro Herrera wrote:

> The more I look at this, the less I like using NameArgExpr for
> namespaces.  It looks all wrong to me, and it causes ugly code all over.
> Maybe I just need to look at it a bit longer.

I think it'd be cleaner to use ResTarget for the namespaces, like
xml_attribute_el does, and split the names from actual exprs in the same
way.  So things like ExecInitExpr become simpler because you just
recurse to initialize the list, without having to examine each element
individually.  tabexprInitialize can just do forboth().

The main reason I don't like abusing NamedArgExpr is that the whole
comment that explains it becomes a lie.

I used your proposed way based on Restarget

Updated patch attached.

Regards

Pavel
 

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

Attachment

pgsql-hackers by date:

Previous
From: Jesper Pedersen
Date:
Subject: Re: [HACKERS] Retiring from the Core Team
Next
From: Peter Eisentraut
Date:
Subject: [HACKERS] pg_upgrade vs. pg_ctl stop -m fast