diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 65f2d242a0f77ded155638b2fa3ef1cd770fc744..87dc6f0c3ba300772f2f5721954cd02448b17596 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -640,9 +640,9 @@ select_perl_context(bool trusted)
 		else
 			plperl_untrusted_init();
 #else
-		errmsg(ERROR,
-			   (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-				errmsg("cannot allocate multiple Perl interpreters on this platform")));
+		ereport(ERROR,
+				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+				 errmsg("cannot allocate multiple Perl interpreters on this platform")));
 #endif
 	}