Re: [HACKERS] patch: function xmltable

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] patch: function xmltable
Дата
Msg-id CAFj8pRAjrX_dtdUdfH2DjEdsh3NZkXV3PLJTjUnyXKji9ChteQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] patch: function xmltable  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: [HACKERS] patch: function xmltable  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список 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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [HACKERS] dropping partitioned tables without CASCADE
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] dropping partitioned tables without CASCADE