Skip site navigation (1) Skip section navigation (2)

Re: BUG #4421: convert_to() should be immutable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: andipeer(at)gmx(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4421: convert_to() should be immutable
Date: 2008-09-17 17:46:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> andipeer(at)gmx(dot)net wrote:
>> The function convert_to(string text, dest_encoding name) is not allowed to
>> be used in a index expression, because it is not marked as "IMMUTABLE".

> You can change the way a conversion is done with CREATE/DROP CONVERSION. 
> That's why it can't be IMMUTABLE.

The other reason is that it depends on the database encoding.  I suppose
you could make an argument that that's fixed for as long as IMMUTABLE
needs to think about --- but we'd have to remember to undo the marking
if database encoding ever becomes less fixed.

Just out of curiosity, what's the use-case for this function in an index

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: ITAGAKI TakahiroDate: 2008-09-18 02:32:31
Subject: 0x1A in control file on Windows
Previous:From: hubert depesz lubaczewskiDate: 2008-09-17 15:49:02
Subject: Re: BUG #4422: select ... where ... NOT EXISTS / NOT IN

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group