Re: Passing XML column in an array

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Passing XML column in an array
Дата
Msg-id 1693386.1644515607@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Passing XML column in an array  (Garfield Lewis <garfield.lewis@lzlabs.com>)
Ответы Re: [EXT] Re: Passing XML column in an array  (Garfield Lewis <garfield.lewis@lzlabs.com>)
Список pgsql-general
Garfield Lewis <garfield.lewis@lzlabs.com> writes:
> I am trying to pass an array into a new function I am creating called lzxmlexists via the following statement:

> wdbs=# SELECT "XT"."ROWKEY" , "XT"."XMLT1C1" FROM "LZQAAS"."T642_XML_T1" "XT" WHERE "ROWKEY"=64201 AND lzxmlexists( '
$XTX//DeptName[. = $Dn    ]', 'DEFAULT', ARRAY["XT"."XMLT1C1"] ) ORDER BY "ROWKEY"; 

> The column XT.XMLT1C1 exists because I can do a simple select to see the contents. The problem is that in the code
aboveI hit the following error at line 161. 

> 160             for ( size_t ix = 0; ix < iXmlCount; ++ix ) {
> (gdb)
> 163                 xmltype  *pX    =  DatumGetXmlP( pXmlData[ix] );
> (gdb)

> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000008b3514 in pg_detoast_datum ()

The most obvious theory is that there are some nulls in the XT.XMLT1C1
column.  Since your code isn't bothering to check pXmlDataNulls[ix],
it would hit a null-pointer dereference when accessing pXmlData[ix].

            regards, tom lane



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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Can we go beyond the standard to make Postgres radically better?
Следующее
От: Garfield Lewis
Дата:
Сообщение: Re: [EXT] Re: Passing XML column in an array