use text argument instead of cstring in pg_msgmodule_set()
authorTomas Vondra <[email protected]>
Thu, 19 Jan 2017 13:08:37 +0000 (14:08 +0100)
committerTomas Vondra <[email protected]>
Thu, 19 Jan 2017 13:08:37 +0000 (14:08 +0100)
opr_sanity checks that functions with cstring arguments are either
type input or conversion functions. Tweaking the function to accept
text seems like a better idea than relaxing opr_sanity tests.

src/backend/utils/error/elog.c
src/include/catalog/pg_proc.h

index c4e366192de509cb8ac0b111f4f723bdc9c26059..2da98efa33080725ebd28042beb52d3ba5e02133 100644 (file)
@@ -4077,7 +4077,7 @@ pg_msgmodule_set(PG_FUNCTION_ARGS)
        int32 moduleid = PG_GETARG_INT32(0);
        int32 fileid = PG_GETARG_INT32(1);
        int32 msgid = PG_GETARG_INT32(2);
-       const char *levelstr = PG_GETARG_CSTRING(3);
+       const char *levelstr = text_to_cstring(PG_GETARG_TEXT_PP(3));
        int32 level;
 
        if (!superuser())
index 8a6f047d8d02148af8bad49647e9a252b38136c7..7fccccf2a4fe7f4eba9e45ca3640f44b9437f2b5 100644 (file)
@@ -5320,7 +5320,7 @@ DATA(insert OID = 6014 ( pg_show_replication_origin_status PGNSP PGUID 12 1 100
 DESCR("get progress for all replication origins");
 
 #ifdef USE_MODULE_MSGIDS
-DATA(insert OID = 6015 ( pg_msgmodule_set PGNSP PGUID 12 1 1 0 0 f f f f t t i s 4 0 16 "20 20 20 2275" _null_ _null_ _null_ _null_ _null_ pg_msgmodule_set _null_ _null_ _null_ ));
+DATA(insert OID = 6015 ( pg_msgmodule_set PGNSP PGUID 12 1 1 0 0 f f f f t t i s 4 0 16 "20 20 20 25" _null_ _null_ _null_ _null_ _null_ pg_msgmodule_set _null_ _null_ _null_ ));
 DESCR("set debugging level for module/file/msg");
 DATA(insert OID = 6016 ( pg_msgmodule_change PGNSP PGUID 12 1 1 0 0 f f f f t t i s 4 0 16 "20 20 20 20" _null_ _null_ _null_ _null_ _null_ pg_msgmodule_change _null_ _null_ _null_ ));
 DESCR("change debugging level for module/file/msg");