@ -637,31 +637,31 @@ showVersion(void)
static void
static void
autocommit_hook ( const char * newval )
autocommit_hook ( const char * newval )
{
{
pset . autocommit = ParseVariableBool ( newval ) ;
pset . autocommit = ParseVariableBool ( newval , " AUTOCOMMIT " ) ;
}
}
static void
static void
on_error_stop_hook ( const char * newval )
on_error_stop_hook ( const char * newval )
{
{
pset . on_error_stop = ParseVariableBool ( newval ) ;
pset . on_error_stop = ParseVariableBool ( newval , " ON_ERROR_STOP " ) ;
}
}
static void
static void
quiet_hook ( const char * newval )
quiet_hook ( const char * newval )
{
{
pset . quiet = ParseVariableBool ( newval ) ;
pset . quiet = ParseVariableBool ( newval , " QUIET " ) ;
}
}
static void
static void
singleline_hook ( const char * newval )
singleline_hook ( const char * newval )
{
{
pset . singleline = ParseVariableBool ( newval ) ;
pset . singleline = ParseVariableBool ( newval , " SINGLELINE " ) ;
}
}
static void
static void
singlestep_hook ( const char * newval )
singlestep_hook ( const char * newval )
{
{
pset . singlestep = ParseVariableBool ( newval ) ;
pset . singlestep = ParseVariableBool ( newval , " SINGLESTEP " ) ;
}
}
static void
static void
@ -675,12 +675,18 @@ echo_hook(const char *newval)
{
{
if ( newval = = NULL )
if ( newval = = NULL )
pset . echo = PSQL_ECHO_NONE ;
pset . echo = PSQL_ECHO_NONE ;
else if ( strcmp ( newval , " queries " ) = = 0 )
else if ( pg_ strcase cmp( newval , " queries " ) = = 0 )
pset . echo = PSQL_ECHO_QUERIES ;
pset . echo = PSQL_ECHO_QUERIES ;
else if ( strcmp ( newval , " all " ) = = 0 )
else if ( pg_ strcase cmp( newval , " all " ) = = 0 )
pset . echo = PSQL_ECHO_ALL ;
pset . echo = PSQL_ECHO_ALL ;
else if ( pg_strcasecmp ( newval , " none " ) = = 0 )
pset . echo = PSQL_ECHO_NONE ;
else
else
{
psql_error ( " unrecognized value \" %s \" for \" %s \" ; assuming \" %s \" \n " ,
newval , " ECHO " , " none " ) ;
pset . echo = PSQL_ECHO_NONE ;
pset . echo = PSQL_ECHO_NONE ;
}
}
}
static void
static void
@ -688,12 +694,12 @@ echo_hidden_hook(const char *newval)
{
{
if ( newval = = NULL )
if ( newval = = NULL )
pset . echo_hidden = PSQL_ECHO_HIDDEN_OFF ;
pset . echo_hidden = PSQL_ECHO_HIDDEN_OFF ;
else if ( strcmp ( newval , " noexec " ) = = 0 )
else if ( pg_ strcase cmp( newval , " noexec " ) = = 0 )
pset . echo_hidden = PSQL_ECHO_HIDDEN_NOEXEC ;
pset . echo_hidden = PSQL_ECHO_HIDDEN_NOEXEC ;
else if ( pg_strcasecmp ( newval , " off " ) = = 0 )
else if ( ParseVariableBool ( newval , " ECHO_HIDDEN " ) )
pset . echo_hidden = PSQL_ECHO_HIDDEN_OFF ;
else
pset . echo_hidden = PSQL_ECHO_HIDDEN_ON ;
pset . echo_hidden = PSQL_ECHO_HIDDEN_ON ;
else /* ParseVariableBool printed msg if needed */
pset . echo_hidden = PSQL_ECHO_HIDDEN_OFF ;
}
}
static void
static void
@ -703,10 +709,10 @@ on_error_rollback_hook(const char *newval)
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_OFF ;
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_OFF ;
else if ( pg_strcasecmp ( newval , " interactive " ) = = 0 )
else if ( pg_strcasecmp ( newval , " interactive " ) = = 0 )
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_INTERACTIVE ;
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_INTERACTIVE ;
else if ( pg_strcasecmp ( newval , " off " ) = = 0 )
else if ( ParseVariableBool ( newval , " ON_ERROR_ROLLBACK " ) )
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_OFF ;
else
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_ON ;
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_ON ;
else /* ParseVariableBool printed msg if needed */
pset . on_error_rollback = PSQL_ERROR_ROLLBACK_OFF ;
}
}
static void
static void
@ -714,14 +720,20 @@ histcontrol_hook(const char *newval)
{
{
if ( newval = = NULL )
if ( newval = = NULL )
pset . histcontrol = hctl_none ;
pset . histcontrol = hctl_none ;
else if ( strcmp ( newval , " ignorespace " ) = = 0 )
else if ( pg_ strcase cmp( newval , " ignorespace " ) = = 0 )
pset . histcontrol = hctl_ignorespace ;
pset . histcontrol = hctl_ignorespace ;
else if ( strcmp ( newval , " ignoredups " ) = = 0 )
else if ( pg_ strcase cmp( newval , " ignoredups " ) = = 0 )
pset . histcontrol = hctl_ignoredups ;
pset . histcontrol = hctl_ignoredups ;
else if ( strcmp ( newval , " ignoreboth " ) = = 0 )
else if ( pg_ strcase cmp( newval , " ignoreboth " ) = = 0 )
pset . histcontrol = hctl_ignoreboth ;
pset . histcontrol = hctl_ignoreboth ;
else if ( pg_strcasecmp ( newval , " none " ) = = 0 )
pset . histcontrol = hctl_none ;
else
else
{
psql_error ( " unrecognized value \" %s \" for \" %s \" ; assuming \" %s \" \n " ,
newval , " HISTCONTROL " , " none " ) ;
pset . histcontrol = hctl_none ;
pset . histcontrol = hctl_none ;
}
}
}
static void
static void
@ -747,14 +759,18 @@ verbosity_hook(const char *newval)
{
{
if ( newval = = NULL )
if ( newval = = NULL )
pset . verbosity = PQERRORS_DEFAULT ;
pset . verbosity = PQERRORS_DEFAULT ;
else if ( strcmp ( newval , " default " ) = = 0 )
else if ( pg_ strcase cmp( newval , " default " ) = = 0 )
pset . verbosity = PQERRORS_DEFAULT ;
pset . verbosity = PQERRORS_DEFAULT ;
else if ( strcmp ( newval , " terse " ) = = 0 )
else if ( pg_ strcase cmp( newval , " terse " ) = = 0 )
pset . verbosity = PQERRORS_TERSE ;
pset . verbosity = PQERRORS_TERSE ;
else if ( strcmp ( newval , " verbose " ) = = 0 )
else if ( pg_ strcase cmp( newval , " verbose " ) = = 0 )
pset . verbosity = PQERRORS_VERBOSE ;
pset . verbosity = PQERRORS_VERBOSE ;
else
else
{
psql_error ( " unrecognized value \" %s \" for \" %s \" ; assuming \" %s \" \n " ,
newval , " VERBOSITY " , " default " ) ;
pset . verbosity = PQERRORS_DEFAULT ;
pset . verbosity = PQERRORS_DEFAULT ;
}
if ( pset . db )
if ( pset . db )
PQsetErrorVerbosity ( pset . db , pset . verbosity ) ;
PQsetErrorVerbosity ( pset . db , pset . verbosity ) ;