diff options
| author | Tom Lane | 2017-05-11 15:49:59 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-05-11 15:49:59 +0000 |
| commit | d10c626de47d8b048b663471c7785603a2ec8641 (patch) | |
| tree | 5506d3a60630deacc55d8f7edb9c51d7f634eec6 /src/backend | |
| parent | b66adb7b0c83e632e0f881f828fa6f4233d01d06 (diff) | |
Rename WAL-related functions and views to use "lsn" not "location".
Per discussion, "location" is a rather vague term that could refer to
multiple concepts. "LSN" is an unambiguous term for WAL locations and
should be preferred. Some function names, view column names, and function
output argument names used "lsn" already, but others used "location",
as well as yet other terms such as "wal_position". Since we've already
renamed a lot of things in this area from "xlog" to "wal" for v10,
we may as well incur a bit more compatibility pain and make these names
all consistent.
David Rowley, minor additional docs hacking by me
Discussion: https://postgr.es/m/CAKJS1f8O0njDKe8ePFQ-LK5-EjwThsDws6ohJ-+c6nWK+oUxtg@mail.gmail.com
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/access/transam/xlogfuncs.c | 12 | ||||
| -rw-r--r-- | src/backend/catalog/system_views.sql | 20 | ||||
| -rw-r--r-- | src/backend/utils/misc/pg_controldata.c | 12 |
3 files changed, 22 insertions, 22 deletions
diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 5041f0e2a9..aa47b0dcff 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -351,7 +351,7 @@ pg_create_restore_point(PG_FUNCTION_ARGS) * to the kernel, but is not necessarily synced to disk. */ Datum -pg_current_wal_location(PG_FUNCTION_ARGS) +pg_current_wal_lsn(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -372,7 +372,7 @@ pg_current_wal_location(PG_FUNCTION_ARGS) * This function is mostly for debugging purposes. */ Datum -pg_current_wal_insert_location(PG_FUNCTION_ARGS) +pg_current_wal_insert_lsn(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -393,7 +393,7 @@ pg_current_wal_insert_location(PG_FUNCTION_ARGS) * This function is mostly for debugging purposes. */ Datum -pg_current_wal_flush_location(PG_FUNCTION_ARGS) +pg_current_wal_flush_lsn(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -415,7 +415,7 @@ pg_current_wal_flush_location(PG_FUNCTION_ARGS) * and synced to disk by walreceiver. */ Datum -pg_last_wal_receive_location(PG_FUNCTION_ARGS) +pg_last_wal_receive_lsn(PG_FUNCTION_ARGS) { XLogRecPtr recptr; @@ -434,7 +434,7 @@ pg_last_wal_receive_location(PG_FUNCTION_ARGS) * connections during recovery. */ Datum -pg_last_wal_replay_location(PG_FUNCTION_ARGS) +pg_last_wal_replay_lsn(PG_FUNCTION_ARGS) { XLogRecPtr recptr; @@ -621,7 +621,7 @@ pg_is_in_recovery(PG_FUNCTION_ARGS) * Compute the difference in bytes between two WAL locations. */ Datum -pg_wal_location_diff(PG_FUNCTION_ARGS) +pg_wal_lsn_diff(PG_FUNCTION_ARGS) { Datum result; diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index 5cd176bc38..0fdad0c119 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -724,10 +724,10 @@ CREATE VIEW pg_stat_replication AS S.backend_start, S.backend_xmin, W.state, - W.sent_location, - W.write_location, - W.flush_location, - W.replay_location, + W.sent_lsn, + W.write_lsn, + W.flush_lsn, + W.replay_lsn, W.write_lag, W.flush_lag, W.replay_lag, @@ -1033,7 +1033,7 @@ CREATE OR REPLACE FUNCTION CREATE OR REPLACE FUNCTION pg_logical_slot_get_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data text) + OUT lsn pg_lsn, OUT xid xid, OUT data text) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1041,7 +1041,7 @@ AS 'pg_logical_slot_get_changes'; CREATE OR REPLACE FUNCTION pg_logical_slot_peek_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data text) + OUT lsn pg_lsn, OUT xid xid, OUT data text) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1049,7 +1049,7 @@ AS 'pg_logical_slot_peek_changes'; CREATE OR REPLACE FUNCTION pg_logical_slot_get_binary_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data bytea) + OUT lsn pg_lsn, OUT xid xid, OUT data bytea) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1057,7 +1057,7 @@ AS 'pg_logical_slot_get_binary_changes'; CREATE OR REPLACE FUNCTION pg_logical_slot_peek_binary_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data bytea) + OUT lsn pg_lsn, OUT xid xid, OUT data bytea) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1066,7 +1066,7 @@ 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, IN temporary boolean DEFAULT false, - OUT slot_name name, OUT wal_position pg_lsn) + OUT slot_name name, OUT lsn pg_lsn) RETURNS RECORD LANGUAGE INTERNAL STRICT VOLATILE @@ -1075,7 +1075,7 @@ AS 'pg_create_physical_replication_slot'; CREATE OR REPLACE FUNCTION pg_create_logical_replication_slot( IN slot_name name, IN plugin name, IN temporary boolean DEFAULT false, - OUT slot_name text, OUT wal_position pg_lsn) + OUT slot_name text, OUT lsn pg_lsn) RETURNS RECORD LANGUAGE INTERNAL STRICT VOLATILE diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c index d8454111a8..56ba301e5a 100644 --- a/src/backend/utils/misc/pg_controldata.c +++ b/src/backend/utils/misc/pg_controldata.c @@ -91,11 +91,11 @@ pg_control_checkpoint(PG_FUNCTION_ARGS) * function's pg_proc entry! */ tupdesc = CreateTemplateTupleDesc(19, false); - TupleDescInitEntry(tupdesc, (AttrNumber) 1, "checkpoint_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 1, "checkpoint_lsn", LSNOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 2, "prior_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 2, "prior_lsn", LSNOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 3, "redo_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 3, "redo_lsn", LSNOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 4, "redo_wal_file", TEXTOID, -1, 0); @@ -225,13 +225,13 @@ pg_control_recovery(PG_FUNCTION_ARGS) * function's pg_proc entry! */ tupdesc = CreateTemplateTupleDesc(5, false); - TupleDescInitEntry(tupdesc, (AttrNumber) 1, "min_recovery_end_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 1, "min_recovery_end_lsn", LSNOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "min_recovery_end_timeline", INT4OID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 3, "backup_start_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 3, "backup_start_lsn", LSNOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 4, "backup_end_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 4, "backup_end_lsn", LSNOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 5, "end_of_backup_record_required", BOOLOID, -1, 0); |
