Thread: SQL/XML publishing function experimental patch
Hello This patch contains SQL/XML public function XMLFOREST, XMLELEMENT, ... based on CString type. This patch hasn't high quality, but can be usefull for testing funcionality, and maybe for some people. Patch needs initdb and following registration: CREATE AGGREGATE pg_catalog.fast_cstring_concat ( BASETYPE = cstring, SFUNC = xmlagg_trans, STYPE = text, FINALFUNC = xmlagg_final); I invite all notes, .. Best regards Pavel Stehule _________________________________________________________________ Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/
Attachment
"Pavel Stehule" <pavel.stehule@hotmail.com> writes: > This patch contains SQL/XML public function XMLFOREST, XMLELEMENT, ... based > on CString type. This patch hasn't high quality, but can be usefull for > testing funcionality, and maybe for some people. 1. Why did you base the datatype on cstring? That's inappropriate for anything except guaranteed-short strings, because it's not toastable. 2. Is it really necessary to hack up the grammar for this? Seems like you should create ordinary functions to manipulate the datatype(s). If every datatype thought it could do this sort of thing, we'd have a completely unmanageable grammar. regards, tom lane
Am Montag, 12. September 2005 16:05 schrieb Tom Lane: > 2. Is it really necessary to hack up the grammar for this? Yes, because the syntax defined in the SQL standard is completely weird. -- Peter Eisentraut http://developer.postgresql.org/~petere/
Tom Lane wrote: >Is it really necessary to hack up the grammar for this? Seems like >you should create ordinary functions to manipulate the datatype(s). >If every datatype thought it could do this sort of thing, we'd have >a completely unmanageable grammar. > > > Can we do variadic functions without hacking the grammar? My impression was that we could not. Maybe we need a generic mechanism for that? Peter said here (more or less uncontradicted) that hacking the grammar would be required for these functions: http://archives.postgresql.org/pgsql-hackers/2004-01/msg00758.php cheers andrew
>1. Why did you base the datatype on cstring? That's inappropriate for >anything except guaranteed-short strings, because it's not toastable. > It's only my laziness. I can adapt patch for TEXT. It's only temporary solution. The goal is true xml type. >2. Is it really necessary to hack up the grammar for this? Seems like >you should create ordinary functions to manipulate the datatype(s). >If every datatype thought it could do this sort of thing, we'd have >a completely unmanageable grammar. > > regards, tom lane I prefere any general solution. But there isn't. I hope SQL/XML syntax is exception and the solution SQL/XML function is relative clean. There was ideas about pretranslators from different syntaxs. Is this idea dead? regards Pavel Stehule _________________________________________________________________ Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci. http://messenger.msn.cz/
This has been saved for the 8.2 release: http://momjian.postgresql.org/cgi-bin/pgpatches_hold --------------------------------------------------------------------------- Pavel Stehule wrote: > Hello > > This patch contains SQL/XML public function XMLFOREST, XMLELEMENT, ... based > on CString type. This patch hasn't high quality, but can be usefull for > testing funcionality, and maybe for some people. Patch needs initdb and > following registration: > > CREATE AGGREGATE pg_catalog.fast_cstring_concat ( > BASETYPE = cstring, > SFUNC = xmlagg_trans, > STYPE = text, > FINALFUNC = xmlagg_final); > > I invite all notes, .. > > Best regards > Pavel Stehule > > _________________________________________________________________ > Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/ [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073