Hi

I used your idea about special columns when COLUMNS are not explicitly
defined.

All lines that you are dislike removed.

Now, almost all code, related to this behave, is in next few lines.

+   /*
+    * Use implicit column when it is necessary. The COLUMNS clause is
optional
+    * on Oracle and DB2. In this case a result is complete row of XML type.
+    */
+   if (rtf->columns == NIL)
+   {
+       RangeTableFuncCol *fc = makeNode(RangeTableFuncCol);
+       A_Const *n = makeNode(A_Const);
+
+       fc->colname = "xmltable";
+       fc->typeName = makeTypeNameFromOid(XMLOID, -1);
+       n->val.type = T_String;
+       n->val.val.str = ".";
+       n->location = -1;
+
+       fc->colexpr = (Node *) n;
+       rtf->columns = list_make1(fc);
+   }

all regress tests passing.

Regards

Pavel

Attachment: xmltable-50.patch.gz
Description: GNU Zip compressed data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to