diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-05-02 15:32:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-05-02 15:32:42 +0000 |
commit | 88f1fd29897df477f0af3c5ffcefe53c697a6ff3 (patch) | |
tree | e279b7a47d27c209a2c2019c3b3069a346a49483 /src/include/utils/elog.h | |
parent | d6013a34f29777254eb5e285a3468960f449de50 (diff) |
Fix oversight in PG_RE_THROW processing: it's entirely possible that there
isn't any place to throw the error to. If so, we should treat the error
as FATAL, just as we would have if it'd been thrown outside the PG_TRY
block to begin with.
Although this is clearly a *potential* source of bugs, it is not clear
at the moment whether it is an *actual* source of bugs; there may not
presently be any PG_TRY blocks in code that can be reached with no outer
longjmp catcher. So for the moment I'm going to be conservative and not
back-patch this. The change breaks ABI for users of PG_RE_THROW and hence
might create compatibility problems for loadable modules, so we should not
put it into released branches without proof that it's needed.
Diffstat (limited to 'src/include/utils/elog.h')
-rw-r--r-- | src/include/utils/elog.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 86fd4deb9ea..e84d67345f9 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.84 2007/03/02 23:37:23 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.85 2007/05/02 15:32:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -223,7 +223,7 @@ extern DLLIMPORT ErrorContextCallback *error_context_stack; } while (0) #define PG_RE_THROW() \ - siglongjmp(*PG_exception_stack, 1) + pg_re_throw() extern DLLIMPORT sigjmp_buf *PG_exception_stack; @@ -262,6 +262,7 @@ extern ErrorData *CopyErrorData(void); extern void FreeErrorData(ErrorData *edata); extern void FlushErrorState(void); extern void ReThrowError(ErrorData *edata); +extern void pg_re_throw(void); /* GUC-configurable parameters */ |