Re: patch for contrib/xml2

Lists: pgsql-patches
From: "Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: patch for contrib/xml2
Date: 2006-09-05 21:55:07
Message-ID: e431ff4c0609051455m1e85f55bta327963d4083248e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hello,

Here is the patch for contrib/xml2 (attached), that:
- renames xml_valid() to xml_is_well_formed()
- adds PG_MODULE_MAGIC; at the beginning of xpath.c
- introduces xpath_array() function
- adds some words about that function and caution about libraries to README

I understand that it's too late, but xpath_array() is pretty simple
function (and, actually, this is a tiny step to XQuery sequences).
Besides that, it is mentioned in the current TODO list and I've told
about this before. Actually, this is at least some [minor] addition for
this module for 8.2.

Let me know if I can help somehow else in this direction.

--
Best regards,
Nikolay

Attachment Content-Type Size
xml2.patch text/x-patch 6.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nikolay(at)samokhvalov(dot)com
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: patch for contrib/xml2
Date: 2006-09-16 16:21:18
Message-ID: 26523.1158423678@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

"Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com> writes:
> Here is the patch for contrib/xml2 (attached), that:
> - renames xml_valid() to xml_is_well_formed()
> - adds PG_MODULE_MAGIC; at the beginning of xpath.c
> - introduces xpath_array() function
> - adds some words about that function and caution about libraries to README

I've applied the part of this patch that renames xml_valid() to
xml_is_well_formed(), as well as the documentation fix. The
PG_MODULE_MAGIC problem was already fixed a few days ago.

I did not apply the addition of xpath_array, on the grounds that
it's well past feature freeze and there doesn't seem to be any
consensus in favor of adding it now. We should revisit this in
8.3 instead.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: nikolay(at)samokhvalov(dot)com, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: patch for contrib/xml2
Date: 2007-02-08 18:42:29
Message-ID: 200702081842.l18IgTf09416@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Should we revisit xpath_array() for 8.3, or is this all in core now?

---------------------------------------------------------------------------

Tom Lane wrote:
> "Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com> writes:
> > Here is the patch for contrib/xml2 (attached), that:
> > - renames xml_valid() to xml_is_well_formed()
> > - adds PG_MODULE_MAGIC; at the beginning of xpath.c
> > - introduces xpath_array() function
> > - adds some words about that function and caution about libraries to README
>
> I've applied the part of this patch that renames xml_valid() to
> xml_is_well_formed(), as well as the documentation fix. The
> PG_MODULE_MAGIC problem was already fixed a few days ago.
>
> I did not apply the addition of xpath_array, on the grounds that
> it's well past feature freeze and there doesn't seem to be any
> consensus in favor of adding it now. We should revisit this in
> 8.3 instead.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, nikolay(at)samokhvalov(dot)com
Subject: Re: patch for contrib/xml2
Date: 2007-02-08 20:30:07
Message-ID: 200702082130.08524.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian wrote:
> Should we revisit xpath_array() for 8.3, or is this all in core now?

Not yet, but we are currently discussing how.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, nikolay(at)samokhvalov(dot)com
Subject: Re: patch for contrib/xml2
Date: 2007-02-18 01:35:02
Message-ID: 200702180135.l1I1Z2r05567@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > Should we revisit xpath_array() for 8.3, or is this all in core now?
>
> Not yet, but we are currently discussing how.

Uh, was this handled?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org, nikolay(at)samokhvalov(dot)com
Subject: Re: patch for contrib/xml2
Date: 2007-02-18 17:26:54
Message-ID: 200702181826.54737.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian wrote:
> Peter Eisentraut wrote:
> > Bruce Momjian wrote:
> > > Should we revisit xpath_array() for 8.3, or is this all in core
> > > now?
> >
> > Not yet, but we are currently discussing how.
>
> Uh, was this handled?

Not yet.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: patch for contrib/xml2
Date: 2007-02-18 18:57:56
Message-ID: e431ff4c0702181057q246d31fdq25ad6fde657156b6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Please wait a little bit, I'll send updated patch (xpath_array() in core)
tonight or tomorrow.

It seems so that there is no actual needs in other xpath-functions...
Just to recall:
- xpath_array() produces xml[] as a result -- so, it's possible to process
then any of returned XML fragments, with proper type casting;
- also xpath_boolean(), xpath_string() and xpath_number() were proposed,
according current functions from contrib/xml2. They are intended to return
scalar value, first found by XPath expression. I saw serious problems with
them -- e.g. it's quite ugly to return always first value of the sequence
(but it might be useful in practice, surely) and, moreover, from my POV,
xpath_string('/a/text()', '<a>very <b>simple</b> example</a>') should
produce 'very simple example' (not 'very ' and not 'very example') -- due
to XML semantics. This differs xpath_string() from other two...

So, my proposal is to include only one function and forget about that three
until we have a better vision ...

I'll raise other (less important) questions with patch sent, shortly.

On 2/18/07, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> Peter Eisentraut wrote:
> > Bruce Momjian wrote:
> > > Should we revisit xpath_array() for 8.3, or is this all in core now?
> >
> > Not yet, but we are currently discussing how.
>
> Uh, was this handled?
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://www.enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +
>

--
Best regards,
Nikolay