Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix argument of pg_create_logical_replication_slot for slot name
authorMichael Paquier <michael@paquier.xyz>
Fri, 13 Jul 2018 00:32:12 +0000 (09:32 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 13 Jul 2018 00:32:12 +0000 (09:32 +0900)
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

src/backend/catalog/system_views.sql
src/backend/replication/slotfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat

index 8cd8bf40ac497f2a91f33993b7f49c6d5550d9c4..7251552419962b901df0cb3bc3efec0bd2b638f9 100644 (file)
@@ -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
index 23af32355b79fc09dfdaeaaddcf08e3cf00329e9..450f73759f972963a01c85c9b04c2aaffe0cdca9 100644 (file)
@@ -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 */
index 66f91a29fcbd3b95d49abc465cadc3616a3a7816..547b156c2d9b7fea5be18e34f1f5141349740a7f 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 201807111
+#define CATALOG_VERSION_NO 201807121
 
 #endif
index 00b59fd6a925c99034c90d1b31855dfe05076b3c..a14651010f273587654f3d8f9af1104ac8a07d35 100644 (file)
 { 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' },