diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
commit | 46651ce6fe013220ed397add242004d764fc0153 (patch) | |
tree | 6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/backend/nodes/value.c | |
parent | Initial commit. (diff) | |
download | postgresql-14-46651ce6fe013220ed397add242004d764fc0153.tar.xz postgresql-14-46651ce6fe013220ed397add242004d764fc0153.zip |
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/backend/nodes/value.c')
-rw-r--r-- | src/backend/nodes/value.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/backend/nodes/value.c b/src/backend/nodes/value.c new file mode 100644 index 0000000..15e6d26 --- /dev/null +++ b/src/backend/nodes/value.c @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------- + * + * value.c + * implementation of Value nodes + * + * + * Copyright (c) 2003-2021, PostgreSQL Global Development Group + * + * + * IDENTIFICATION + * src/backend/nodes/value.c + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "nodes/parsenodes.h" + +/* + * makeInteger + */ +Value * +makeInteger(int i) +{ + Value *v = makeNode(Value); + + v->type = T_Integer; + v->val.ival = i; + return v; +} + +/* + * makeFloat + * + * Caller is responsible for passing a palloc'd string. + */ +Value * +makeFloat(char *numericStr) +{ + Value *v = makeNode(Value); + + v->type = T_Float; + v->val.str = numericStr; + return v; +} + +/* + * makeString + * + * Caller is responsible for passing a palloc'd string. + */ +Value * +makeString(char *str) +{ + Value *v = makeNode(Value); + + v->type = T_String; + v->val.str = str; + return v; +} + +/* + * makeBitString + * + * Caller is responsible for passing a palloc'd string. + */ +Value * +makeBitString(char *str) +{ + Value *v = makeNode(Value); + + v->type = T_BitString; + v->val.str = str; + return v; +} |