From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Craig Ringer <craig(at)2ndquadrant(dot)com> |
Subject: | Re: patch: function xmltable |
Date: | 2017-03-05 09:32:18 |
Message-ID: | CAFj8pRAjrX_dtdUdfH2DjEdsh3NZkXV3PLJTjUnyXKji9ChteQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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 | Content-Type | Size |
---|---|---|
xmltable-50.patch.gz | application/x-gzip | 36.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2017-03-05 10:02:08 | Re: dropping partitioned tables without CASCADE |
Previous Message | Ashutosh Bapat | 2017-03-05 07:59:33 | Re: dropping partitioned tables without CASCADE |