summaryrefslogtreecommitdiff
path: root/src/bin/psql/variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/variables.c')
-rw-r--r--src/bin/psql/variables.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c
index b9a3dfad331..03d218ea129 100644
--- a/src/bin/psql/variables.c
+++ b/src/bin/psql/variables.c
@@ -264,6 +264,24 @@ SetVariableAssignHook(VariableSpace space, const char *name, VariableAssignHook
return true;
}
+/*
+ * Return true iff the named variable has an assign hook function.
+ */
+bool
+VariableHasHook(VariableSpace space, const char *name)
+{
+ struct _variable *current;
+
+ Assert(space);
+ Assert(name);
+
+ for (current = space->next; current; current = current->next)
+ if (strcmp(current->name, name) == 0)
+ return current->assign_hook != NULL;
+
+ return false;
+}
+
bool
SetVariableBool(VariableSpace space, const char *name)
{