From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chapman Flack <chap@anastigmatix.net>
Cc: Ryan Lambert <ryan@rustprooflabs.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Fix XML handling with DOCTYPE
Date: Sun, 17 Mar 2019 15:06:07 -0400
Message-ID: <25228.1552849567@sss.pgh.pa.us> (raw)
In-Reply-To: <5C8E8E2F.9050600@anastigmatix.net>
References: <CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com>
<5C8D5D16.7090206@anastigmatix.net>
<23319.1552769738@sss.pgh.pa.us>
<5C8D6681.4070504@anastigmatix.net>
<24203.1552771272@sss.pgh.pa.us>
<5C8D79AF.7010204@anastigmatix.net>
<5146.1552837534@sss.pgh.pa.us>
<5C8E7FC0.8040401@anastigmatix.net>
<31664.1552842991@sss.pgh.pa.us>
<5C8E8E2F.9050600@anastigmatix.net>
Chapman Flack <chap@anastigmatix.net> writes:
> On 03/17/19 13:16, Tom Lane wrote:
>> Do we need a pre-scan at all?
> Without it, we double the time to a failure result in every case that
> should actually fail, as well as in this one corner case that we want to
> see succeed, and the question you posed earlier about which error message
> to return becomes thornier.
I have absolutely zero concern about whether it takes twice as long to
detect bad input; nobody should be sending bad input if they're concerned
about performance. (The costs of the ensuing transaction abort would
likely dwarf xml_in's runtime in any case.) Besides, with what we're
talking about doing here,
(1) the extra runtime is consumed only in cases that would fail up to now,
so nobody can complain about a performance regression;
(2) doing a pre-scan *would* be a performance regression for cases that
work today; not a large one we hope, but still...
The error message issue is indeed a concern, but I don't see why it's
complicated if you agree that
> If the query asked for CONTENT, any error result should be one you could get
> when parsing as CONTENT.
That just requires us to save the first error message and be sure to issue
that one not the DOCUMENT one, no? That's what we'd want to do from a
backwards-compatibility standpoint anyhow, since that's the error message
wording you'd get with today's code.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, chap@anastigmatix.net, ryan@rustprooflabs.com
Subject: Re: Fix XML handling with DOCTYPE
In-Reply-To: <25228.1552849567@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox