aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2018-07-13 09:32:12 +0900
committerMichael Paquier <michael@paquier.xyz>2018-07-13 09:32:12 +0900
commitce89ad0fa07d98e20380867811a5269ee36d45c7 (patch)
tree1ea358f5f9c894146c1dcef33d44aca072f5e199
parent5fc1008e8a8b9e96ac75b4db5dd9ad2b99a9c8b2 (diff)
downloadpostgresql-ce89ad0fa07d98e20380867811a5269ee36d45c7.tar.gz
postgresql-ce89ad0fa07d98e20380867811a5269ee36d45c7.zip
Fix argument of pg_create_logical_replication_slot for slot name
All attributes and arguments using a slot name map to the data type "name", but this function has been using "text". This is cosmetic, as even if text is used then the slot name would be truncated to 64 characters anyway and stored as such. The documentation already said so and the function already assumed that the argument was of this type when fetching its value. Bump catalog version. Author: Sawada Masahiko Discussion: https://postgr.es/m/CAD21AoADYz_-eAqH5AVFaCaojcRgwpo9PW=u8kgTMys63oB8Cw@mail.gmail.com
-rw-r--r--src/backend/catalog/system_views.sql2
-rw-r--r--src/backend/replication/slotfuncs.c2
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_proc.dat2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 8cd8bf40ac4..72515524199 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1081,7 +1081,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 lsn pg_lsn)
+ OUT slot_name name, OUT lsn pg_lsn)
RETURNS RECORD
LANGUAGE INTERNAL
STRICT VOLATILE
diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c
index 23af32355b7..450f73759f9 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -142,7 +142,7 @@ pg_create_logical_replication_slot(PG_FUNCTION_ARGS)
/* build initial snapshot, might take a while */
DecodingContextFindStartpoint(ctx);
- values[0] = CStringGetTextDatum(NameStr(MyReplicationSlot->data.name));
+ values[0] = NameGetDatum(&MyReplicationSlot->data.name);
values[1] = LSNGetDatum(MyReplicationSlot->data.confirmed_flush);
/* don't need the decoding context anymore */
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 66f91a29fcb..547b156c2d9 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201807111
+#define CATALOG_VERSION_NO 201807121
#endif
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 00b59fd6a92..a14651010f2 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -9803,7 +9803,7 @@
{ oid => '3786', descr => 'set up a logical replication slot',
proname => 'pg_create_logical_replication_slot', provolatile => 'v',
proparallel => 'u', prorettype => 'record', proargtypes => 'name name bool',
- proallargtypes => '{name,name,bool,text,pg_lsn}',
+ proallargtypes => '{name,name,bool,name,pg_lsn}',
proargmodes => '{i,i,i,o,o}',
proargnames => '{slot_name,plugin,temporary,slot_name,lsn}',
prosrc => 'pg_create_logical_replication_slot' },