@@ -333,13 +333,17 @@ _PG_init(void)
333333Oid
334334get_pathman_config_relid (bool invalid_is_ok )
335335{
336+ if (!IsPathmanInitialized ())
337+ {
338+ if (invalid_is_ok )
339+ return InvalidOid ;
340+ elog (ERROR , "pg_pathman is not initialized yet" );
341+ }
342+
336343 /* Raise ERROR if Oid is invalid */
337344 if (!OidIsValid (pathman_config_relid ) && !invalid_is_ok )
338- elog (ERROR ,
339- (!IsPathmanInitialized () ?
340- "pg_pathman is not initialized yet" :
341- "unexpected error in function "
342- CppAsString (get_pathman_config_relid )));
345+ elog (ERROR , "unexpected error in function "
346+ CppAsString (get_pathman_config_relid ));
343347
344348 return pathman_config_relid ;
345349}
@@ -348,13 +352,17 @@ get_pathman_config_relid(bool invalid_is_ok)
348352Oid
349353get_pathman_config_params_relid (bool invalid_is_ok )
350354{
355+ if (!IsPathmanInitialized ())
356+ {
357+ if (invalid_is_ok )
358+ return InvalidOid ;
359+ elog (ERROR , "pg_pathman is not initialized yet" );
360+ }
361+
351362 /* Raise ERROR if Oid is invalid */
352363 if (!OidIsValid (pathman_config_relid ) && !invalid_is_ok )
353- elog (ERROR ,
354- (!IsPathmanInitialized () ?
355- "pg_pathman is not initialized yet" :
356- "unexpected error in function "
357- CppAsString (get_pathman_config_params_relid )));
364+ elog (ERROR , "unexpected error in function "
365+ CppAsString (get_pathman_config_params_relid ));
358366
359367 return pathman_config_params_relid ;
360368}
0 commit comments