From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "Colin 't Hart" <colinthart(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: What happened to the is_<type> family of functions proposal? |
Date: | 2010-09-21 23:57:37 |
Message-ID: | 201009212357.o8LNvbN13015@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Robert Haas wrote:
> On Tue, Sep 21, 2010 at 7:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> >> I don't understand the argument that we need type input functions to
> >> be protected by a savepoint. ?That seems crazy to me. ?We're taking a
> >> huge performance penalty here to protect against something that seems
> >> insane to me in the first instance. ?Not to mention cutting ourselves
> >> off from really important features, like the ability to recover from
> >> errors during COPY. ?I don't understand why we can't just make some
> >> rules about what type input functions are allowed to do.
> >
> > There are many rules that you could possibly make for type input
> > functions. ?But "you cannot throw an error" is not one of them ---
> > or at least, not one that you can usefully expect to be followed
> > for anything more than trivial straightline code.
>
> OK. This is one of the things I don't understand. Why does throwing
> an error imply that we need to abort the current transaction? Why
> can't we just catch the longjmp() and trundle onwards? Obviously,
> that's unsafe if a pretty wide variety of cases, but if you're just
> scrutinizing the input string (even with a little bit of read-only
> database access) it's not obvious to me what can go wrong. (I assume
> there is something, but I don't know what it is...)
That would be interesting. You would need to flag that this was not a
longjump requiring cleanup, but the harder part would be getting back to
where the error occurred. I guess you could rerun the query. :-|
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2010-09-22 00:04:55 | Re: Configuring synchronous replication |
Previous Message | Robert Haas | 2010-09-21 23:55:43 | Re: What happened to the is_<type> family of functions proposal? |