From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Jeff Davis <pgsql(at)j-davis(dot)com>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, laurenz(dot)albe(at)wien(dot)gv(dot)at, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] invalidly encoded strings |
Date: | 2007-09-16 02:05:55 |
Message-ID: | 46EC8F83.1030503@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
and this time the patch is attached
Andrew Dunstan wrote:
>
>
> Tom Lane wrote:
>> What I think we'd need to have a complete solution is
>>
>> convert(text, name) returns bytea
>> -- convert from DB encoding to arbitrary encoding
>>
>> convert(bytea, name, name) returns bytea
>> -- convert between any two encodings
>>
>> convert(bytea, name) returns text
>> -- convert from arbitrary encoding to DB encoding
>>
>> The second and third would need to do a verify step before
>> converting, of course.
>>
>>
>>
>
> Here's a patch that implements the above. It actually does the verify
> step for all three cases - if that bothers people I can remove it at
> the cost of a little code complexity.
>
> It also fixes the "convert ... using ..." case in a similar way (makes
> it return a bytea).
>
> On reflection I think we also need to provide length(bytea, name) as
> has been suggested, so we can check the length in the foreign encoding
> of a bytea we have converted this way. That shouldn't be too difficult
> to add.
>
> cheers
>
> andrew
>
Attachment | Content-Type | Size |
---|---|---|
codfix2.patch | text/x-patch | 9.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2007-09-16 09:56:30 | Re: Hmmm ... isn't count_nondeletable_pages all wet? |
Previous Message | Andrew Dunstan | 2007-09-16 02:04:56 | Re: [HACKERS] invalidly encoded strings |
From | Date | Subject | |
---|---|---|---|
Next Message | Stefan Kaltenbrunner | 2007-09-16 15:57:46 | Re: PL/TCL Patch to prevent postgres from becoming multithreaded |
Previous Message | Andrew Dunstan | 2007-09-16 02:04:56 | Re: [HACKERS] invalidly encoded strings |