Re: Bytea/Base64 encoders for libpq - interested?

From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, Joerg Hessdoerfer <Joerg(dot)Hessdoerfer(at)sea-gmbh(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bytea/Base64 encoders for libpq - interested?
Date: 2001-08-29 01:58:12
Message-ID: 3.0.5.32.20010829095812.008453f0@192.228.128.13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Lincoln Yeoh 2001-08-29 02:22:22 Re: Bytea/Base64 encoders for libpq - interested?
Previous Message Larry Rosenman 2001-08-28 18:19:48 Re: NetBSD 1.5.1(HP300)

Browse pgsql-patches by date

  From Date Subject
Next Message Lincoln Yeoh 2001-08-29 02:22:22 Re: Bytea/Base64 encoders for libpq - interested?
Previous Message Jeroen van Vianen 2001-08-28 21:32:43 Patch for broken JDBC's getColumn()