Re: Bytea/Base64 encoders for libpq - interested? - Mailing list pgsql-hackers

From Lincoln Yeoh
Subject Re: Bytea/Base64 encoders for libpq - interested?
Date
Msg-id 3.0.5.32.20010829095812.008453f0@192.228.128.13
Whole thread Raw
In response to Re: Bytea/Base64 encoders for libpq - interested?  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
At 11:55 AM 28-08-2001 +0200, Karel Zak wrote:
>
> What implement base64 PostgreSQL datetype that use externaly base64 and
>internaly same things as bytea. It prevent FE and parser problems with
>"bad" chars and internaly for data storage save less space than text
>with base64. Of course it doesn't solve a problem with encoding/decoding 
>data in your application to/from base64. May be implement for this
>datetype cast to/from bytea too.
>
> SELECT my_bytea::base64 FROM foo;
>
> INSERT INTO foo (my_bytea) VALUES ('some_base64_string'::bytea);
>
> And you can still fetch all data directly in batea by binary cursor. 
>
> Comments?

Sounds good to me. Even better if the base64 parser is bulletproof and
tolerant of junk. That way base64 email attachments may not even need to be
processed much - just filter a bit and shove it in :).

But shouldn't there be a ::base64 somewhere in the insert statement?

Cheerio,
Link.



pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: NetBSD 1.5.1(HP300)
Next
From: Lincoln Yeoh
Date:
Subject: Re: Bytea/Base64 encoders for libpq - interested?