Re: array_cat without duplicity

From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: Ondřej Fafejta <ondrej(dot)fafejta(at)kyberie(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: array_cat without duplicity
Date: 2008-03-19 15:51:50
Message-ID: 87abkuogo9.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 19 Mar 2008, Ondřej Fafejta <ondrej(dot)fafejta(at)kyberie(dot)cz> writes:
> SELECT array_cat(ARRAY[1,2], ARRAY[2,3]);
> array_cat
> -----------
> {1,2,2,3}
>
> I need to get result without duplicity!
> {1,2,3}

I don't know any builtin way of achieving such a thing. But you may want
to use intarray contrib module or implement your own PL function to
remove duplicates from an array.

Regards.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Zubkovsky, Sergey 2008-03-19 16:59:52 Row size overhead
Previous Message patrick 2008-03-19 15:45:16 Re: tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3