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

From: Andreas Peer <andipeer(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4421: convert_to() should be immutable
Date: 2008-09-19 08:16:15
Message-ID: 48D35FCF.3090405@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane schrieb:
> Andreas Peer <andipeer(at)gmx(dot)net> writes:
>
>> Well, the use case is a strange one... I would like to use a varchar()
>> column for storing a variable-length vector of integers. The numbers are
>> represented by the codepoints. Therefore, I need to sort them as binary
>> data, not as characters. I would often need to get all the vectors that
>> lie in between to vectors, therefore I need the "binary" index.
>>
>
> Use bytea maybe?
>
>
Than I cannot access the single characters anymore (or I just use bytes,
but that limits a number to 256...)
>> And the code should be as database independent as possible, therefore I
>> cannot use an array or another data type that may not be supported by
>> other DBMS.
>>
>
> I can't imagine how you'd think that a functional index on convert_to()
> would be the most portable solution ...
>
nearly every DBMS has a function for converting character strings to
binary strings, I would just have to change the function
name/parameters, but the rest of the query could be the same
> regards, tom lane
>
>
Regards,
Andreas Peer

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2008-09-19 14:23:20 Re: [HACKERS] 0x1A in control file on Windows
Previous Message Kieran McCusker 2008-09-18 17:37:26 BUG #4425: cannot pg_restore from pg_dump --format=c