Re: sort a referenced list

Поиск
Список
Период
Сортировка
От Matthew Peter
Тема Re: sort a referenced list
Дата
Msg-id 20060404192259.66257.qmail@web35208.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: sort a referenced list  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: sort a referenced list  (Jim Nasby <jnasby@pervasive.com>)
Список pgsql-general


Tom Lane <tgl@sss.pgh.pa.us> wrote:
Matthew Peter writes:
> What I'm trying to do is create a function that accepts a list then sorts and groups the values (like in sql)... I will have an unique list I can convert it to an array later or leave it a list

There is no "list" data structure in SQL. There are tables, and there
are arrays, but it's not especially easy to pass an arbitrary table
value to a function. So you almost certainly need to define your
problem as "create a function that accepts an array then ...".

regards, tom lane

Originally I wanted to pass in text or varchar array, group it, sort it then do as I willed with it, but I couldn't figure out how. I saw some functions in the contrib for doing these operations, yet only with integer arrays.

I could always try converting the array_sort, array_uniq int[] C function to accept text[], but I decided to ask and see if there was a simplier/standard way first since I don't know C all that well.

Thanks


Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.

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

Предыдущее
От: "Thomas F. O'Connell"
Дата:
Сообщение: Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks
Следующее
От: "patrick"
Дата:
Сообщение: Re: recover from base directory?