summaryrefslogtreecommitdiff
path: root/src/backend/catalog/system_views.sql
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-08-11 12:34:31 +0200
committerAndres Freund <andres@anarazel.de>2015-08-11 12:34:31 +0200
commit6fcd88511f8e69e38defb1272e0042ef4bab2feb (patch)
tree5334ee3074cedde450ff688d26af4371c0d39c8b /src/backend/catalog/system_views.sql
parent093d0c83c1d210167d122da92459a0677e04ffc9 (diff)
downloadpostgresql-6fcd88511f8e69e38defb1272e0042ef4bab2feb.tar.gz
Allow pg_create_physical_replication_slot() to reserve WAL.
When creating a physical slot it's often useful to immediately reserve the current WAL position instead of only doing after the first feedback message arrives. That e.g. allows slots to guarantee that all the WAL for a base backup will be available afterwards. Logical slots already have to reserve WAL during creation, so generalize that logic into being usable for both physical and logical slots. Catversion bump because of the new parameter. Author: Gurjeet Singh Reviewed-By: Andres Freund Discussion: CABwTF4Wh_dBCzTU=49pFXR6coR4NW1ynb+vBqT+Po=7fuq5iCw@mail.gmail.com
Diffstat (limited to 'src/backend/catalog/system_views.sql')
-rw-r--r--src/backend/catalog/system_views.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 3190c7f7e0..ccc030fd7f 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -917,6 +917,13 @@ LANGUAGE INTERNAL
VOLATILE ROWS 1000 COST 1000
AS 'pg_logical_slot_peek_binary_changes';
+CREATE OR REPLACE FUNCTION pg_create_physical_replication_slot(
+ IN slot_name name, IN immediately_reserve boolean DEFAULT false,
+ OUT slot_name name, OUT xlog_position pg_lsn)
+RETURNS RECORD
+LANGUAGE INTERNAL
+AS 'pg_create_physical_replication_slot';
+
CREATE OR REPLACE FUNCTION
make_interval(years int4 DEFAULT 0, months int4 DEFAULT 0, weeks int4 DEFAULT 0,
days int4 DEFAULT 0, hours int4 DEFAULT 0, mins int4 DEFAULT 0,