Re: Expanded Objects and Order By
От | Paul Ramsey |
---|---|
Тема | Re: Expanded Objects and Order By |
Дата | |
Msg-id | 933D0559-FAC7-4970-9573-0CFF34CCB444@cleverelephant.ca обсуждение исходный текст |
Ответ на | Re: Expanded Objects and Order By (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Expanded Objects and Order By
Re: Expanded Objects and Order By |
Список | pgsql-hackers |
Thank the Maker, it is reproduceable: returning an expanded header in the _in function is not appreciated in a very narrownumber of cases. Edit arrayfuncs.c:array_in(), change the return line thus: // PG_RETURN_ARRAYTYPE_P(retval); PG_RETURN_DATUM(expand_array(PointerGetDatum(retval), CurrentMemoryContext, my_extra)); And here is a small test case that exercises it: CREATE TABLE orderby_expanded ( id integer, a integer[] ); INSERT INTO orderby_expanded (id, a) VALUES (1, ARRAY[1,2]); -- works SELECT id, a FROM orderby_expanded ORDER BY a = '{1,2}'::integer[]; -- ERROR: could not find pathkey item to sort SELECT id FROM orderby_expanded ORDER BY a = '{1,2}'::integer[]; -- works SELECT id FROM orderby_expanded ORDER BY a = ARRAY[1,2];
В списке pgsql-hackers по дате отправления: