Re: Functional index and string concatenation

From: Daniel Henrique Alves Lima <email_daniel_h(at)yahoo(dot)com(dot)br>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Functional index and string concatenation
Date: 2004-03-08 16:02:53
Message-ID: 404C992D.1060407@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Yes, i was searching for the name of equivalent function to "||"
operator...

Now, i've got a new problem: I need to concat three values (two
column values and a sepator constant). But from documentation: " The
function in the index definition can take more than one argument, but
they must be table columns, not constants" and "there cannot be
multicolumn indexes that contain function calls".

Maybe i should to create a new pgsql function.

Thanks !

Edmund Bacon wrote:

>On Mon, 2004-03-08 at 08:19, Daniel Henrique Alves Lima wrote:
>
>
>> Is there a way to create a "functional index" over a string
>>concatenation of two columns ?
>>
>> Thanks.
>>
>>
>>
>Like this?
>
>test=# create table strtable (x int, str1 text, str2 text);
>CREATE TABLE
>test=# create index str_idx on strtable( textcat(str1, str2) );
>CREATE INDEX
>test=#
>
>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2004-03-08 17:38:46 Re: Functional index and string concatenation
Previous Message terry 2004-03-08 16:02:13 Trying to make efficient "all vendors who can provide all items"