Re: XML export function signatures

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: XML export function signatures
Date: 2007-02-12 19:45:06
Message-ID: 45D0C3C2.80004@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lukas Kahwe Smith 2007-02-12 19:52:49 OT: IRC nick to real world mapping
Previous Message Peter Eisentraut 2007-02-12 19:18:59 XML export function signatures