aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/pg_lsn.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-06-30 10:15:25 +0200
committerPeter Eisentraut <peter@eisentraut.org>2019-06-30 10:27:43 +0200
commit21f428ebde39339487c271a830fed135d6032d73 (patch)
tree0a69ab528a79a31f3306a1d60c190c09a1fca085 /src/include/utils/pg_lsn.h
parent666cbae16da46b833f57ef8b12ff0bf215684d9c (diff)
downloadpostgresql-21f428ebde39339487c271a830fed135d6032d73.tar.gz
postgresql-21f428ebde39339487c271a830fed135d6032d73.zip
Don't call data type input functions in GUC check hooks
Instead of calling pg_lsn_in() in check_recovery_target_lsn and timestamptz_in() in check_recovery_target_time, reorganize the respective code so that we don't raise any errors in the check hooks. The previous code tried to use PG_TRY/PG_CATCH to handle errors in a way that is not safe, so now the code contains no ereport() calls and can operate safely within the GUC error handling system. Moreover, since the interpretation of the recovery_target_time string may depend on the time zone, we cannot do the final processing of that string until all the GUC processing is done. Instead, check_recovery_target_time() now does some parsing for syntax checking, but the actual conversion to a timestamptz value is done later in the recovery code that uses it. Reported-by: Andres Freund <andres@anarazel.de> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/20190611061115.njjwkagvxp4qujhp%40alap3.anarazel.de
Diffstat (limited to 'src/include/utils/pg_lsn.h')
-rw-r--r--src/include/utils/pg_lsn.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/utils/pg_lsn.h b/src/include/utils/pg_lsn.h
index def5b25aa37..70d8640ef3e 100644
--- a/src/include/utils/pg_lsn.h
+++ b/src/include/utils/pg_lsn.h
@@ -24,4 +24,6 @@
#define PG_GETARG_LSN(n) DatumGetLSN(PG_GETARG_DATUM(n))
#define PG_RETURN_LSN(x) return LSNGetDatum(x)
+extern XLogRecPtr pg_lsn_in_internal(const char *str, bool *have_error);
+
#endif /* PG_LSN_H */