MCPcopy Create free account
hub / github.com/apache/cloudberry / cursor_to_xmlschema

Function cursor_to_xmlschema

src/backend/utils/adt/xml.c:2763–2786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2761
2762
2763Datum
2764cursor_to_xmlschema(PG_FUNCTION_ARGS)
2765{
2766 char *name = text_to_cstring(PG_GETARG_TEXT_PP(0));
2767 bool nulls = PG_GETARG_BOOL(1);
2768 bool tableforest = PG_GETARG_BOOL(2);
2769 const char *targetns = text_to_cstring(PG_GETARG_TEXT_PP(3));
2770 const char *xmlschema;
2771 Portal portal;
2772
2773 SPI_connect();
2774 portal = SPI_cursor_find(name);
2775 if (portal == NULL)
2776 ereport(ERROR,
2777 (errcode(ERRCODE_UNDEFINED_CURSOR),
2778 errmsg("cursor \"%s\" does not exist", name)));
2779
2780 xmlschema = _SPI_strdup(map_sql_table_to_xmlschema(portal->tupDesc,
2781 InvalidOid, nulls,
2782 tableforest, targetns));
2783 SPI_finish();
2784
2785 PG_RETURN_XML_P(cstring_to_xmltype(xmlschema));
2786}
2787
2788
2789Datum

Callers

nothing calls this directly

Calls 9

text_to_cstringFunction · 0.85
SPI_connectFunction · 0.85
SPI_cursor_findFunction · 0.85
_SPI_strdupFunction · 0.85
SPI_finishFunction · 0.85
cstring_to_xmltypeFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected