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

From Andres Freund
Subject Re: [HACKERS] patch: function xmltable
Date
Msg-id 20170124223744.moyzln5vifjbkl7s@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] patch: function xmltable  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [HACKERS] patch: function xmltable  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2017-01-24 17:38:49 -0300, Alvaro Herrera wrote:
> +static Datum ExecEvalTableExpr(TableExprState *tstate, ExprContext *econtext,
> +                  bool *isnull);
> +static Datum ExecEvalTableExprFast(TableExprState *exprstate, ExprContext *econtext,
> +                      bool *isNull);
> +static Datum tabexprFetchRow(TableExprState *tstate, ExprContext *econtext,
> +                bool *isNull);
> +static void tabexprInitialize(TableExprState *tstate, ExprContext *econtext,
> +                  Datum doc);
> +static void ShutdownTableExpr(Datum arg);

To me this (and a lot of the other code) hints quite strongly that
expression evalution is the wrong approach to implementing this.  What
you're essentially doing is building a vulcano style scan node.  Even if
we can this, we shouldn't double down on the bad decision to have these
magic expressions that return multiple rows.  There's historical reason
for tSRFs, but we shouldn't add more weirdness like this.

Andres



pgsql-hackers by date:

Previous
From: Nikita Glukhov
Date:
Subject: Re: [HACKERS] PATCH: recursive json_populate_record()
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] patch: function xmltable