static bool check_enabled( bool *newval, void **extra, GucSource source) { if ( initstage < IS_PLJAVA_ENABLED ) return true; if ( *newval ) return true; GUC_check_errmsg( "too late to change \"pljava.enable\" setting"); GUC_check_errdetail( "Start-up has progressed past the point where it is checked."); GUC_check_errhint( "For another chance, exit this session and start a new one."); return false; }
static bool check_libjvm_location( char **newval, void **extra, GucSource source) { if ( initstage < IS_CAND_JVMOPENED ) return true; if ( libjvmlocation == *newval ) return true; if ( libjvmlocation && *newval && 0 == strcmp(libjvmlocation, *newval) ) return true; GUC_check_errmsg( "too late to change \"pljava.libjvm_location\" setting"); GUC_check_errdetail( "Changing the setting can have no effect after " "PL/Java has found and opened the library it points to."); GUC_check_errhint( "To try a different value, exit this session and start a new one."); return false; }
static bool check_classpath( char **newval, void **extra, GucSource source) { if ( initstage < IS_JAVAVM_OPTLIST ) return true; if ( classpath == *newval ) return true; if ( classpath && *newval && 0 == strcmp(classpath, *newval) ) return true; GUC_check_errmsg( "too late to change \"pljava.classpath\" setting"); GUC_check_errdetail( "Changing the setting has no effect after " "PL/Java has started the Java virtual machine."); GUC_check_errhint( "To try a different value, exit this session and start a new one."); return false; }
static bool eudc_fallback_character_check_hook( const char **newval, void** extra, GucSource source) { int len; GUC_check_errhint("must be one character or empty string"); /* handle explicit setting of eudc.fallback_character */ if (*newval) { /* eudc.fallback_character * should be 0 or 1 character */ len = pg_mbstrlen(*newval); if (len >= 2 || len < 0) return false; } return true; }