Re: [HACKERS] Troubles with array_ref

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Troubles with array_ref
Дата
Msg-id 9297.1131487972@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Troubles with array_ref  ("Cristian Prieto" <cristian@clickdiario.com>)
Ответы Re: [HACKERS] Troubles with array_ref  ("Cristian Prieto" <cristian@clickdiario.com>)
Список pgsql-general
"Cristian Prieto" <cristian@clickdiario.com> writes:
> Well, anyway, this is the Stored Function I've been workin on; it simply
> take an array and an integer just to return this item from the array; The
> array could have any kind of elements so I declare it as anyarray (the
> parameter) and anyelement (the return value), please help me, I don't know
> where to get info about it.

You could save yourself a lot of time if you enabled warnings from your
C compiler (eg, -Wall for gcc) and then paid some attention to them.
The last parameter to array_ref is a bool *, not a bool, and I have no
doubt that the backend is crashing while trying to dereference "false".

(Another problem is that the fourth parameter should be -1 not VARSIZE.)

            regards, tom lane

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

Предыдущее
От: "Cristian Prieto"
Дата:
Сообщение: Troubles with array_ref
Следующее
От: Ledina Hido
Дата:
Сообщение: Transactions, Triggers and Error Messages