Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d672ea6f
Commit
d672ea6f
authored
Apr 04, 2008
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn xmlbinary and xmloption GUC variables into enumsTurn xmlbinary and
xmloption GUC variables into enums..
parent
55f6e5f6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
66 deletions
+37
-66
src/backend/utils/adt/xml.c
src/backend/utils/adt/xml.c
+3
-3
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+31
-60
src/include/utils/xml.h
src/include/utils/xml.h
+3
-3
No files found.
src/backend/utils/adt/xml.c
View file @
d672ea6f
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.7
1 2008/03/25 22:42:44 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.7
2 2008/04/04 08:33:15 mha
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -86,8 +86,8 @@
/* GUC variables */
XmlBinaryType
xmlbinary
;
XmlOptionType
xmloption
;
int
xmlbinary
;
int
xmloption
;
#ifdef USE_LIBXML
...
...
src/backend/utils/misc/guc.c
View file @
d672ea6f
...
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.44
3 2008/04/03 13:25:02
mha Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.44
4 2008/04/04 08:33:15
mha Exp $
*
*--------------------------------------------------------------------
*/
...
...
@@ -155,8 +155,6 @@ static bool assign_transaction_read_only(bool newval, bool doit, GucSource sourc
static
const
char
*
assign_canonical_path
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_backslash_quote
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_timezone_abbreviations
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_xmlbinary
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
assign_xmloption
(
const
char
*
newval
,
bool
doit
,
GucSource
source
);
static
const
char
*
show_archive_command
(
void
);
static
bool
assign_tcp_keepalives_idle
(
int
newval
,
bool
doit
,
GucSource
source
);
static
bool
assign_tcp_keepalives_interval
(
int
newval
,
bool
doit
,
GucSource
source
);
...
...
@@ -243,6 +241,17 @@ static const struct config_enum_entry syslog_facility_options[] = {
};
#endif
static
const
struct
config_enum_entry
xmlbinary_options
[]
=
{
{
"base64"
,
XMLBINARY_BASE64
},
{
"hex"
,
XMLBINARY_HEX
},
{
NULL
,
0
}
};
static
const
struct
config_enum_entry
xmloption_options
[]
=
{
{
"content"
,
XMLOPTION_CONTENT
},
{
"document"
,
XMLOPTION_DOCUMENT
},
{
NULL
,
0
}
};
/*
* GUC option variables that are exported from this module
...
...
@@ -316,8 +325,6 @@ static char *timezone_abbreviations_string;
static
char
*
XactIsoLevel_string
;
static
char
*
data_directory
;
static
char
*
custom_variable_classes
;
static
char
*
xmlbinary_string
;
static
char
*
xmloption_string
;
static
int
max_function_args
;
static
int
max_index_keys
;
static
int
max_identifier_length
;
...
...
@@ -2382,25 +2389,6 @@ static struct config_string ConfigureNamesString[] =
NULL
,
assign_canonical_path
,
NULL
},
{
{
"xmlbinary"
,
PGC_USERSET
,
CLIENT_CONN_STATEMENT
,
gettext_noop
(
"Sets how binary values are to be encoded in XML."
),
gettext_noop
(
"Valid values are BASE64 and HEX."
)
},
&
xmlbinary_string
,
"base64"
,
assign_xmlbinary
,
NULL
},
{
{
"xmloption"
,
PGC_USERSET
,
CLIENT_CONN_STATEMENT
,
gettext_noop
(
"Sets whether XML data in implicit parsing and serialization "
"operations is to be considered as documents or content fragments."
),
gettext_noop
(
"Valid values are DOCUMENT and CONTENT."
)
},
&
xmloption_string
,
"content"
,
assign_xmloption
,
NULL
},
{
{
"default_text_search_config"
,
PGC_USERSET
,
CLIENT_CONN_LOCALE
,
gettext_noop
(
"Sets default text search configuration."
),
...
...
@@ -2524,6 +2512,25 @@ static struct config_enum ConfigureNamesEnum[] =
assign_session_replication_role
,
NULL
},
{
{
"xmlbinary"
,
PGC_USERSET
,
CLIENT_CONN_STATEMENT
,
gettext_noop
(
"Sets how binary values are to be encoded in XML."
),
gettext_noop
(
"Valid values are BASE64 and HEX."
)
},
&
xmlbinary
,
XMLBINARY_BASE64
,
xmlbinary_options
,
NULL
,
NULL
},
{
{
"xmloption"
,
PGC_USERSET
,
CLIENT_CONN_STATEMENT
,
gettext_noop
(
"Sets whether XML data in implicit parsing and serialization "
"operations is to be considered as documents or content fragments."
),
gettext_noop
(
"Valid values are DOCUMENT and CONTENT."
)
},
&
xmloption
,
XMLOPTION_CONTENT
,
xmloption_options
,
NULL
,
NULL
},
/* End-of-list marker */
{
...
...
@@ -7172,42 +7179,6 @@ pg_timezone_abbrev_initialize(void)
}
}
static
const
char
*
assign_xmlbinary
(
const
char
*
newval
,
bool
doit
,
GucSource
source
)
{
XmlBinaryType
xb
;
if
(
pg_strcasecmp
(
newval
,
"base64"
)
==
0
)
xb
=
XMLBINARY_BASE64
;
else
if
(
pg_strcasecmp
(
newval
,
"hex"
)
==
0
)
xb
=
XMLBINARY_HEX
;
else
return
NULL
;
/* reject */
if
(
doit
)
xmlbinary
=
xb
;
return
newval
;
}
static
const
char
*
assign_xmloption
(
const
char
*
newval
,
bool
doit
,
GucSource
source
)
{
XmlOptionType
xo
;
if
(
pg_strcasecmp
(
newval
,
"document"
)
==
0
)
xo
=
XMLOPTION_DOCUMENT
;
else
if
(
pg_strcasecmp
(
newval
,
"content"
)
==
0
)
xo
=
XMLOPTION_CONTENT
;
else
return
NULL
;
/* reject */
if
(
doit
)
xmloption
=
xo
;
return
newval
;
}
static
const
char
*
show_archive_command
(
void
)
{
...
...
src/include/utils/xml.h
View file @
d672ea6f
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.2
3 2008/01/15 18:57:00 tgl
Exp $
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.2
4 2008/04/04 08:33:15 mha
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -83,8 +83,8 @@ typedef enum
XMLBINARY_HEX
}
XmlBinaryType
;
extern
XmlBinaryType
xmlbinary
;
extern
int
xmlbinary
;
/* XmlBinaryType, but int for guc enum */
extern
XmlOptionType
xmloption
;
extern
int
xmloption
;
/* XmlOptionType, but int for guc enum */
#endif
/* XML_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment