Re: Regression with large XML data input

From: zengman <zengman(at)halodbtech(dot)com>
To: Erik Wienhold <ewie(at)ewie(dot)name>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Regression with large XML data input
Date: 2025-12-25 07:29:04
Message-ID: tencent_2789D934383FA63637EFDB9E@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> The whitespace can be preserved by setting xmlKeepBlanksDefault before
> parsing. See attached v2. That function is deprecated, though. But
> libxml2 uses thread-local globals, so it should be safe. Other than
> that, I see no other way to set XML_PARSE_NOBLANKS with
> xmlParseBalancedChunkMemory.
>
> [1] https://gitlab.gnome.org/GNOME/libxml2/-/blob/408bd0e18e6ddba5d18e51d52da0f7b3ca1b4421/parserInternals.c#L2833

Hi everyone,

I have a small issue that needs resolving.

My environment:
```
postgres(at)zxm-VMware-Virtual-Platform:~$ uname -i -s -r -v
Linux 6.11.0-29-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:29:41 UTC 2025 x86_64
postgres(at)zxm-VMware-Virtual-Platform:~$
postgres(at)zxm-VMware-Virtual-Platform:~$ xml2-config --version
2.12.7
```

After setting COPT=-Werror, compilation fails with the following errors (warnings are enforced as errors):
```
xml.c: In function ‘xml_parse’:
xml.c:1919:25: error: ‘xmlKeepBlanksDefault’ is deprecated [-Werror=deprecated-declarations]
1919 | save_keep_blanks = xmlKeepBlanksDefault(preserve_whitespace ? 1 : 0);
| ^~~~~~~~~~~~~~~~
In file included from xml.c:51:
/usr/include/libxml2/libxml/parser.h:957:17: note: declared here
957 | xmlKeepBlanksDefault (int val);
| ^~~~~~~~~~~~~~~~~~~~
xml.c:1943:25: error: ‘xmlKeepBlanksDefault’ is deprecated [-Werror=deprecated-declarations]
1943 | xmlKeepBlanksDefault(save_keep_blanks);
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/libxml2/libxml/parser.h:957:17: note: declared here
957 | xmlKeepBlanksDefault (int val);
| ^~~~~~~~~~~~~~~~~~~~
xml.c:1956:17: error: ‘xmlKeepBlanksDefault’ is deprecated [-Werror=deprecated-declarations]
1956 | xmlKeepBlanksDefault(save_keep_blanks);
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/libxml2/libxml/parser.h:957:17: note: declared here
957 | xmlKeepBlanksDefault (int val);
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

These deprecation warnings do not impact the test results in any way.
Therefore, I have attached a patch to suppress these specific warnings.

--
Regards,
Man Zeng
www.openhalo.org

Attachment Content-Type Size
0001-Suppress-deprecation-warning-for-xmlKeepBlanksDefaul.patch application/octet-stream 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-12-25 07:40:34 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Chao Li 2025-12-25 07:25:43 Re: Fix typos: 'Bejing' to 'Beijing' in partition regress/docs