Re: Consolidate 'unique array values' logic into a reusable function?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Consolidate 'unique array values' logic into a reusable function?
Дата
Msg-id 22244.1470585142@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Consolidate 'unique array values' logic into a reusable function?  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: Consolidate 'unique array values' logic into a reusable function?  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> Here's a sketch patch that creates a function array_unique which takes
> the same arguments as qsort or qsort_arg and returns the new length.

Hmm ... I'd be against using this in backend/regex/, because I still
have hopes of converting that to a standalone library someday (and
in any case it needs to stay compatible with Tcl's copy of the code).
But otherwise this seems like a reasonable proposal.

As for the function name, maybe "qunique()" to go with "qsort()"?
I'm not thrilled with "array_unique" because that sounds like it
is meant for Postgres' array data types.
        regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Heap WARM Tuples - Design Draft
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bogus ANALYZE results for an otherwise-unique column with many nulls