Re: [PATCH] Add CANONICAL option to xmlserialize

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Chapman Flack <chap(at)anastigmatix(dot)net>, vignesh C <vignesh21(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Add CANONICAL option to xmlserialize
Date: 2024-08-25 18:57:30
Message-ID: CAFj8pRDtW94U2inD3tXiF++JvL3gzYrCfqZh4hHTHovkES+Ezg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

so 24. 8. 2024 v 7:40 odesílatel Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
napsal:

>
> On 19.06.24 10:59, Jim Jones wrote:
> > On 09.02.24 14:19, Jim Jones wrote:
> >> v9 attached with rebase due to changes done to primnodes.h in 615f5f6
> >>
> > v10 attached with rebase due to changes in primnodes, parsenodes.h, and
> > gram.y
> >
> v11 attached with rebase due to changes in xml.c
>

I try to check this patch

There is unwanted white space in the patch

-<-><--><-->xmlFreeDoc(doc);
+<->else if (format == XMLSERIALIZE_CANONICAL || format ==
XMLSERIALIZE_CANONICAL_WITH_NO_COMMENTS)
+ <>{
+<-><-->xmlChar *xmlbuf = NULL;
+<-><-->int nbytes;
+<-><-->int

1. the xml is serialized to UTF8 string every time, but when target type is
varchar or text, then it should be every time encoded to database encoding.
Is not possible to hold utf8 string in latin2 database varchar.

2. The proposed feature can increase some confusion in implementation of NO
IDENT. I am not an expert on this area, so I checked other databases. DB2
does not have anything similar. But Oracle's "NO IDENT" clause is very
similar to the proposed "CANONICAL". Unfortunately, there is different
behaviour of NO IDENT - Oracle's really removes formatting, Postgres does
nothing.

Regards

Pavel

> --
> Jim
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-08-25 19:00:00 Re: type cache cleanup improvements
Previous Message Tom Lane 2024-08-25 17:28:13 Re: Non-trivial condition is only propagated to one side of JOIN