Re: XML export function signatures - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: XML export function signatures
Date
Msg-id 45D0C3C2.80004@dunslane.net
Whole thread Raw
In response to XML export function signatures  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: XML export function signatures  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers

Peter Eisentraut wrote:
> Here are the proposed signatures for the XML export functions.
>
> While I have seen the output formats in use elsewhere, I could not find
> any useful information on how to invoke these mappings, so the
> following is purely my own invention.
>
> table_to_xml(tbl regclass, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> query_to_xml(query text, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> table_to_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> table_to_xml_and_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> query_to_xml_and_xmlschema(query text, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> cursor_get_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, targetns text) RETURNS xml
> cursor_to_xmlschema(cursor refcursor, nulls boolean, tableforest boolean, targetns text) RETURNS xml
>
> The table_* variants export named tables, and the output will have some
> degree of catalog information about the tables, which will have to be
> omitted for the query_* variants.  The cursor_* variants exist for
> supporting the export of large structures.
>
> *_to_xml gives you the data, *_to_xmlschema the associated XML Schema
> document, and *_to_xml_and_xmlschema gives you both in one XML document
> and linked together.
>
> The argument "nulls" specifies whether to include null values,
> "tableforest" switches between two alternative ways of
> representing the data, and "targetns" is the target (XML)
> namespace.
>
>
>
>   

Looks fairly sound.

. table_to_xml_and_xmlschema  seems like a mouthful - can we shorten it a bit?

. what are the two ways of representing data that tableforest distinguishes?

. can we have versions that supply defaults for params after the first?


cheers

andrew






pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: XML export function signatures
Next
From: Lukas Kahwe Smith
Date:
Subject: OT: IRC nick to real world mapping