git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 7302514) | patch
PG_FINALLY
Fri, 1 Nov 2019 10:09:52 +0000 (11:09 +0100)
Fri, 1 Nov 2019 10:18:03 +0000 (11:18 +0100)
commit 604bd3671121b51f977de146ed95484c2297fb3e
PG_FINALLY

This gives an alternative way of catching exceptions, for the common
case where the cleanup code is the same in the error and non-error
cases. So instead of

PG_TRY();
{
... code that might throw ereport(ERROR) ...
}
PG_CATCH();
{
cleanup();
PG_RE_THROW();
}
PG_END_TRY();
cleanup();

one can write

PG_TRY();
{
... code that might throw ereport(ERROR) ...
}
PG_FINALLY();
{
cleanup();
}
PG_END_TRY();

Discussion: https://www.postgresql.org/message-id/flat/95a822c3-728b-af0e-d7e5-71890507ae0c%402ndquadrant.com
32 files changed:
contrib/auto_explain/auto_explain.c diff | blob | blame | history
contrib/dblink/dblink.c diff | blob | blame | history
contrib/hstore_plpython/hstore_plpython.c diff | blob | blame | history
contrib/jsonb_plpython/jsonb_plpython.c diff | blob | blame | history
contrib/pg_stat_statements/pg_stat_statements.c diff | blob | blame | history
contrib/pg_trgm/trgm_regexp.c diff | blob | blame | history
contrib/postgres_fdw/connection.c diff | blob | blame | history
contrib/postgres_fdw/postgres_fdw.c diff | blob | blame | history
contrib/sepgsql/hooks.c diff | blob | blame | history
contrib/sepgsql/label.c diff | blob | blame | history
contrib/sepgsql/selinux.c diff | blob | blame | history
contrib/sepgsql/uavc.c diff | blob | blame | history
src/backend/catalog/index.c diff | blob | blame | history
src/backend/commands/async.c diff | blob | blame | history
src/backend/commands/copy.c diff | blob | blame | history
src/backend/commands/event_trigger.c diff | blob | blame | history
src/backend/commands/extension.c diff | blob | blame | history
src/backend/commands/subscriptioncmds.c diff | blob | blame | history
src/backend/commands/trigger.c diff | blob | blame | history
src/backend/commands/vacuum.c diff | blob | blame | history
src/backend/libpq/be-fsstubs.c diff | blob | blame | history
src/backend/tcop/utility.c diff | blob | blame | history
src/backend/utils/adt/xml.c diff | blob | blame | history
src/include/utils/elog.h diff | blob | blame | history
src/pl/plperl/plperl.c diff | blob | blame | history
src/pl/plpgsql/src/pl_handler.c diff | blob | blame | history
src/pl/plpython/plpy_cursorobject.c diff | blob | blame | history
src/pl/plpython/plpy_elog.c diff | blob | blame | history
src/pl/plpython/plpy_exec.c diff | blob | blame | history
src/pl/plpython/plpy_spi.c diff | blob | blame | history
src/pl/plpython/plpy_typeio.c diff | blob | blame | history
src/pl/tcl/pltcl.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /