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
3cde4437
Commit
3cde4437
authored
Oct 15, 2010
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change references to SQL/XML:2003 to :2008 and renumber sections accordingly
parent
71d24466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
39 deletions
+38
-39
src/backend/utils/adt/xml.c
src/backend/utils/adt/xml.c
+38
-39
No files found.
src/backend/utils/adt/xml.c
View file @
3cde4437
...
@@ -137,7 +137,7 @@ static void SPI_sql_row_to_xmlelement(int rownum, StringInfo result,
...
@@ -137,7 +137,7 @@ static void SPI_sql_row_to_xmlelement(int rownum, StringInfo result,
errhint("You need to rebuild PostgreSQL using --with-libxml.")))
errhint("You need to rebuild PostgreSQL using --with-libxml.")))
/* from SQL/XML:200
3 section 4.7
*/
/* from SQL/XML:200
8 section 4.9
*/
#define NAMESPACE_XSD "http://www.w3.org/2001/XMLSchema"
#define NAMESPACE_XSD "http://www.w3.org/2001/XMLSchema"
#define NAMESPACE_XSI "http://www.w3.org/2001/XMLSchema-instance"
#define NAMESPACE_XSI "http://www.w3.org/2001/XMLSchema-instance"
#define NAMESPACE_SQLXML "http://standards.iso.org/iso/9075/2003/sqlxml"
#define NAMESPACE_SQLXML "http://standards.iso.org/iso/9075/2003/sqlxml"
...
@@ -1200,9 +1200,9 @@ xml_parse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace,
...
@@ -1200,9 +1200,9 @@ xml_parse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace,
{
{
/*
/*
* Note, that here we try to apply DTD defaults
* Note, that here we try to apply DTD defaults
* (XML_PARSE_DTDATTR) according to SQL/XML:10.16.7.d: 'Default
* (XML_PARSE_DTDATTR) according to SQL/XML:
2008 GR
10.16.7.d: 'Default
* values defined by internal DTD are applied'. As for external
* values defined by internal DTD are applied'. As for external
* DTDs, we try to support them too, (see SQL/XML:10.16.7.e)
* DTDs, we try to support them too, (see SQL/XML:
2008 GR
10.16.7.e)
*/
*/
doc
=
xmlCtxtReadDoc
(
ctxt
,
utf8string
,
doc
=
xmlCtxtReadDoc
(
ctxt
,
utf8string
,
NULL
,
NULL
,
...
@@ -1490,7 +1490,7 @@ is_valid_xml_namechar(pg_wchar c)
...
@@ -1490,7 +1490,7 @@ is_valid_xml_namechar(pg_wchar c)
/*
/*
* Map SQL identifier to XML name; see SQL/XML:200
3
section 9.1.
* Map SQL identifier to XML name; see SQL/XML:200
8
section 9.1.
*/
*/
char
*
char
*
map_sql_identifier_to_xml_name
(
char
*
ident
,
bool
fully_escaped
,
map_sql_identifier_to_xml_name
(
char
*
ident
,
bool
fully_escaped
,
...
@@ -1570,7 +1570,7 @@ unicode_to_sqlchar(pg_wchar c)
...
@@ -1570,7 +1570,7 @@ unicode_to_sqlchar(pg_wchar c)
/*
/*
* Map XML name to SQL identifier; see SQL/XML:200
3 section 9.17
.
* Map XML name to SQL identifier; see SQL/XML:200
8 section 9.3
.
*/
*/
char
*
char
*
map_xml_name_to_sql_identifier
(
char
*
name
)
map_xml_name_to_sql_identifier
(
char
*
name
)
...
@@ -1603,16 +1603,14 @@ map_xml_name_to_sql_identifier(char *name)
...
@@ -1603,16 +1603,14 @@ map_xml_name_to_sql_identifier(char *name)
}
}
/*
/*
* Map SQL value to XML value; see SQL/XML:200
3 section 9.16
.
* Map SQL value to XML value; see SQL/XML:200
8 section 9.8
.
*
*
* When xml_escape_strings is true, then certain characters in string
* When xml_escape_strings is true, then certain characters in string
* values are replaced by entity references (< etc.), as specified
* values are replaced by entity references (< etc.), as specified
* in SQL/XML:200
3 section 9.16 GR 8)
ii). This is normally what is
* in SQL/XML:200
8 section 9.8 GR 9) a) i
ii). This is normally what is
* wanted. The false case is mainly useful when the resulting value
* wanted. The false case is mainly useful when the resulting value
* is used with xmlTextWriterWriteAttribute() to write out an
* is used with xmlTextWriterWriteAttribute() to write out an
* attribute, because that function does the escaping itself. The SQL
* attribute, because that function does the escaping itself.
* standard of 2003 is somewhat buggy in this regard, so we do our
* best to make sense.
*/
*/
char
*
char
*
map_sql_value_to_xml_value
(
Datum
value
,
Oid
type
,
bool
xml_escape_strings
)
map_sql_value_to_xml_value
(
Datum
value
,
Oid
type
,
bool
xml_escape_strings
)
...
@@ -1868,12 +1866,13 @@ _SPI_strdup(const char *s)
...
@@ -1868,12 +1866,13 @@ _SPI_strdup(const char *s)
/*
/*
* SQL to XML mapping functions
* SQL to XML mapping functions
*
*
* What follows below
is intentionally organized so that you can read
* What follows below
was at one point intentionally organized so that
*
along in the SQL/XML:2003 standard. The functions are mostly split
*
you can read along in the SQL/XML standard. The functions are
*
up and ordered they
way the clauses lay out in the standards
*
mostly split up the
way the clauses lay out in the standards
* document, and the identifiers are also aligned with the standard
* document, and the identifiers are also aligned with the standard
* text. (SQL/XML:2006 appears to be ordered differently,
* text. Unfortunately, SQL/XML:2006 reordered the clauses
* unfortunately.)
* differently than SQL/XML:2003, so the order below doesn't make much
* sense anymore.
*
*
* There are many things going on there:
* There are many things going on there:
*
*
...
@@ -1902,8 +1901,8 @@ _SPI_strdup(const char *s)
...
@@ -1902,8 +1901,8 @@ _SPI_strdup(const char *s)
/*
/*
* Visibility of objects for XML mappings; see SQL/XML:200
3
section
* Visibility of objects for XML mappings; see SQL/XML:200
8
section
* 4.
8.5
.
* 4.
10.8
.
*/
*/
/*
/*
...
@@ -1972,8 +1971,8 @@ database_get_xml_visible_tables(void)
...
@@ -1972,8 +1971,8 @@ database_get_xml_visible_tables(void)
/*
/*
* Map SQL table to XML and/or XML Schema document; see SQL/XML:200
3
* Map SQL table to XML and/or XML Schema document; see SQL/XML:200
8
* section 9.
3
.
* section 9.
11
.
*/
*/
static
StringInfo
static
StringInfo
...
@@ -2269,8 +2268,8 @@ query_to_xml_and_xmlschema(PG_FUNCTION_ARGS)
...
@@ -2269,8 +2268,8 @@ query_to_xml_and_xmlschema(PG_FUNCTION_ARGS)
/*
/*
* Map SQL schema to XML and/or XML Schema document; see SQL/XML:200
3
* Map SQL schema to XML and/or XML Schema document; see SQL/XML:200
8
* section
9.
4.
* section
s 9.13, 9.1
4.
*/
*/
static
StringInfo
static
StringInfo
...
@@ -2446,8 +2445,8 @@ schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS)
...
@@ -2446,8 +2445,8 @@ schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS)
/*
/*
* Map SQL database to XML and/or XML Schema document; see SQL/XML:200
3
* Map SQL database to XML and/or XML Schema document; see SQL/XML:200
8
* section
9.5
.
* section
s 9.16, 9.17
.
*/
*/
static
StringInfo
static
StringInfo
...
@@ -2578,7 +2577,7 @@ database_to_xml_and_xmlschema(PG_FUNCTION_ARGS)
...
@@ -2578,7 +2577,7 @@ database_to_xml_and_xmlschema(PG_FUNCTION_ARGS)
/*
/*
* Map a multi-part SQL name to an XML name; see SQL/XML:200
3
section
* Map a multi-part SQL name to an XML name; see SQL/XML:200
8
section
* 9.2.
* 9.2.
*/
*/
static
char
*
static
char
*
...
@@ -2606,11 +2605,11 @@ map_multipart_sql_identifier_to_xml_name(char *a, char *b, char *c, char *d)
...
@@ -2606,11 +2605,11 @@ map_multipart_sql_identifier_to_xml_name(char *a, char *b, char *c, char *d)
/*
/*
* Map an SQL table to an XML Schema document; see SQL/XML:200
3
* Map an SQL table to an XML Schema document; see SQL/XML:200
8
* section 9.
3
.
* section 9.
11
.
*
*
* Map an SQL table to XML Schema data types; see SQL/XML:200
3
section
* Map an SQL table to XML Schema data types; see SQL/XML:200
8
section
* 9.
6
.
* 9.
9
.
*/
*/
static
const
char
*
static
const
char
*
map_sql_table_to_xmlschema
(
TupleDesc
tupdesc
,
Oid
relid
,
bool
nulls
,
map_sql_table_to_xmlschema
(
TupleDesc
tupdesc
,
Oid
relid
,
bool
nulls
,
...
@@ -2712,8 +2711,8 @@ map_sql_table_to_xmlschema(TupleDesc tupdesc, Oid relid, bool nulls,
...
@@ -2712,8 +2711,8 @@ map_sql_table_to_xmlschema(TupleDesc tupdesc, Oid relid, bool nulls,
/*
/*
* Map an SQL schema to XML Schema data types; see SQL/XML
section
* Map an SQL schema to XML Schema data types; see SQL/XML
:2008
*
9.7
.
*
section 9.12
.
*/
*/
static
const
char
*
static
const
char
*
map_sql_schema_to_xmlschema_types
(
Oid
nspid
,
List
*
relid_list
,
bool
nulls
,
map_sql_schema_to_xmlschema_types
(
Oid
nspid
,
List
*
relid_list
,
bool
nulls
,
...
@@ -2785,8 +2784,8 @@ map_sql_schema_to_xmlschema_types(Oid nspid, List *relid_list, bool nulls,
...
@@ -2785,8 +2784,8 @@ map_sql_schema_to_xmlschema_types(Oid nspid, List *relid_list, bool nulls,
/*
/*
* Map an SQL catalog to XML Schema data types; see SQL/XML
section
* Map an SQL catalog to XML Schema data types; see SQL/XML
:2008
*
9.8
.
*
section 9.15
.
*/
*/
static
const
char
*
static
const
char
*
map_sql_catalog_to_xmlschema_types
(
List
*
nspid_list
,
bool
nulls
,
map_sql_catalog_to_xmlschema_types
(
List
*
nspid_list
,
bool
nulls
,
...
@@ -2843,7 +2842,7 @@ map_sql_catalog_to_xmlschema_types(List *nspid_list, bool nulls,
...
@@ -2843,7 +2842,7 @@ map_sql_catalog_to_xmlschema_types(List *nspid_list, bool nulls,
/*
/*
* Map an SQL data type to an XML name; see SQL/XML:200
3 section 9.9
.
* Map an SQL data type to an XML name; see SQL/XML:200
8 section 9.4
.
*/
*/
static
const
char
*
static
const
char
*
map_sql_type_to_xml_name
(
Oid
typeoid
,
int
typmod
)
map_sql_type_to_xml_name
(
Oid
typeoid
,
int
typmod
)
...
@@ -2948,7 +2947,7 @@ map_sql_type_to_xml_name(Oid typeoid, int typmod)
...
@@ -2948,7 +2947,7 @@ map_sql_type_to_xml_name(Oid typeoid, int typmod)
/*
/*
* Map a collection of SQL data types to XML Schema data types; see
* Map a collection of SQL data types to XML Schema data types; see
* SQL/XML:200
2 section 9.10
.
* SQL/XML:200
8 section 9.7
.
*/
*/
static
const
char
*
static
const
char
*
map_sql_typecoll_to_xmlschema_types
(
List
*
tupdesc_list
)
map_sql_typecoll_to_xmlschema_types
(
List
*
tupdesc_list
)
...
@@ -2997,12 +2996,12 @@ map_sql_typecoll_to_xmlschema_types(List *tupdesc_list)
...
@@ -2997,12 +2996,12 @@ map_sql_typecoll_to_xmlschema_types(List *tupdesc_list)
/*
/*
* Map an SQL data type to a named XML Schema data type; see
SQL/XML
* Map an SQL data type to a named XML Schema data type; see
*
sections 9.11 and 9.15
.
*
SQL/XML:2008 sections 9.5 and 9.6
.
*
*
* (The distinction between 9.
11 and 9.15 is basically that 9.15
adds
* (The distinction between 9.
5 and 9.6 is basically that 9.6
adds
* a name attribute, which this function does. The name-less version
* a name attribute, which this function does. The name-less version
* 9.
11
doesn't appear to be required anywhere.)
* 9.
5
doesn't appear to be required anywhere.)
*/
*/
static
const
char
*
static
const
char
*
map_sql_type_to_xmlschema_type
(
Oid
typeoid
,
int
typmod
)
map_sql_type_to_xmlschema_type
(
Oid
typeoid
,
int
typmod
)
...
@@ -3179,7 +3178,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
...
@@ -3179,7 +3178,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
/*
/*
* Map an SQL row to an XML element, taking the row from the active
* Map an SQL row to an XML element, taking the row from the active
* SPI cursor. See also SQL/XML:200
3 section 9.12
.
* SPI cursor. See also SQL/XML:200
8 section 9.10
.
*/
*/
static
void
static
void
SPI_sql_row_to_xmlelement
(
int
rownum
,
StringInfo
result
,
char
*
tablename
,
SPI_sql_row_to_xmlelement
(
int
rownum
,
StringInfo
result
,
char
*
tablename
,
...
...
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