Re: patch: function xmltable

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: function xmltable
Date: 2016-09-12 04:42:08
Message-ID: CAFj8pRDsBeTRR3xDXbHnR19ifCRrnq7SDwM=b-i_=5mbhOzTVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-09-12 6:36 GMT+02:00 Craig Ringer <craig(at)2ndquadrant(dot)com>:

> On 12 September 2016 at 12:28, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> >> I'll take a closer read-through shortly.
>
> >DEFAULT
> > isn't a normal literal, it's an xpath expression evaluated at the same
> > time as the rowexpression.
>
> Sorry for the spam, but turns out that's not the case as implemented
> here. The docs you referenced say it should be an xpath expression,
> but the implementation here is of a literal value, and examples
> elsewhere on the Internet show a literal value. Unclear if the
> referenced docs are wrong or what and I don't have anything to test
> with.
>

It is not spam. The previous comment was not correct. DEFAULT is a
expression - result of this expression is used, when data is missing.

In standard, and some others implementation, this is literal only. It is
similar to DEFAULT clause in CREATE STATEMENT. Postgres allows expression
there. Usually Postgres allows expressions everywhere when it has sense,
and when it is allowed by bizon parser.

>
> Feel free to fix/trim the DEFAULT related changes in above docs patch as
> needed.
>
> Also, tests/docs should probably cover what happens when PATH matches
> more than one element, i.e. produces a list of more than one match.
>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-09-12 05:07:18 Re: patch: function xmltable
Previous Message Craig Ringer 2016-09-12 04:36:28 Re: patch: function xmltable