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

Re: Bytea/Base64 encoders for libpq - interested?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: Joerg Hessdoerfer <Joerg(dot)Hessdoerfer(at)sea-gmbh(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bytea/Base64 encoders for libpq - interested?
Date: 2001-09-04 00:16:52
Message-ID: 200109040016.f840Gqa04205@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Where did we leave this?

> On Tue, Aug 28, 2001 at 11:07:32AM +0200, Joerg Hessdoerfer wrote:
> > Hi!
> > 
> > Please find attached some very simple encoders/decoders for bytea and base64.
> > Bytea encoder is very picky about what it leaves unescaped - basically the 
> > base64
> > char set ;-)
> > 
> > Since this seems to be a very poorly documented but much asked-for thing, I 
> > thought
> > you would maybe like to add this code to libpq (so that everyone benefits).
> > 
> > I'm aware that function renames might be necessary, though.
> > If you like, I could make the code fit into libpq, and send diffs.
> > 
> > Any comments/interests?
> 
>  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?
> 
> 		Karel
> -- 
>  Karel Zak  <zakkr(at)zf(dot)jcu(dot)cz>
>  http://home.zf.jcu.cz/~zakkr/
>  
>  C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2001-09-04 00:40:38
Subject: Re: Re: Escaping strings for inclusion into SQL queries
Previous:From: Tom LaneDate: 2001-09-04 00:10:19
Subject: Re: Re: Escaping strings for inclusion into SQL queries

pgsql-patches by date

Next:From: Peter EisentrautDate: 2001-09-04 00:42:28
Subject: Re: Makefiles for building with mingw32 on win32
Previous:From: Bruce MomjianDate: 2001-09-03 23:47:59
Subject: Re: Makefiles for building with mingw32 on win32

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