diff options
| author | Robert Haas <rhaas@postgresql.org> | 2014-02-19 11:13:44 -0500 |
|---|---|---|
| committer | Robert Haas <rhaas@postgresql.org> | 2014-02-19 11:37:43 -0500 |
| commit | 6f289c2b7d00f07f13f679092f7c71f78950e9da (patch) | |
| tree | e90efb09103b8306a659a03a2b8fbcb55ab92c92 /src/backend/replication/slotfuncs.c | |
| parent | 694e3d139a9d090c58494428bebfadad216419da (diff) | |
Switch various builtin functions to use pg_lsn instead of text.
The functions in slotfuncs.c don't exist in any released version,
but the changes to xlogfuncs.c represent backward-incompatibilities.
Per discussion, we're hoping that the queries using these functions
are few enough and simple enough that this won't cause too much
breakage for users.
Michael Paquier, reviewed by Andres Freund and further modified
by me.
Diffstat (limited to 'src/backend/replication/slotfuncs.c')
| -rw-r--r-- | src/backend/replication/slotfuncs.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index 98a860e5288..761c0f536fb 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -17,6 +17,7 @@ #include "miscadmin.h" #include "access/htup_details.h" #include "utils/builtins.h" +#include "utils/pg_lsn.h" #include "replication/slot.h" Datum pg_create_physical_replication_slot(PG_FUNCTION_ARGS); @@ -141,8 +142,6 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) bool active; Oid database; const char *slot_name; - - char restart_lsn_s[MAXFNAMELEN]; int i; SpinLockAcquire(&slot->mutex); @@ -164,9 +163,6 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) memset(nulls, 0, sizeof(nulls)); - snprintf(restart_lsn_s, sizeof(restart_lsn_s), "%X/%X", - (uint32) (restart_lsn >> 32), (uint32) restart_lsn); - i = 0; values[i++] = CStringGetTextDatum(slot_name); if (database == InvalidOid) @@ -180,7 +176,7 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) else nulls[i++] = true; if (restart_lsn != InvalidTransactionId) - values[i++] = CStringGetTextDatum(restart_lsn_s); + values[i++] = LSNGetDatum(restart_lsn); else nulls[i++] = true; |
