Re: Patch to eliminate duplicate b64 code from pgcrypto

Поиск
Список
Период
Сортировка
От Marc Munro
Тема Re: Patch to eliminate duplicate b64 code from pgcrypto
Дата
Msg-id 1229631700.7683.44.camel@bloodnok.com
обсуждение исходный текст
Ответ на Patch to eliminate duplicate b64 code from pgcrypto  (Marc Munro <marc@bloodnok.com>)
Список pgsql-hackers
Oops, forgot to cc my reply to hackers:

On Thu, 2008-12-18 at 01:49 +0200, Marko Kreen wrote:
> On 12/16/08, Bruce Momjian <bruce@momjian.us> wrote:
> >  Would someone who understand pgcrypto please review this?
>
> >  Marc Munro wrote:
> > > I am attaching a patch to eliminate duplicate b64_encode and decode
> >  > functions from pgcrypto, and to expose those functions for use by
> >  > add-ins (I want to use them in Veil).
>
> Although your patch achieves the goal, it may make more sense to export
> pg_find_encoding() and struct pg_encoding, thus making all encoding
> algorithms available externally.

I had a very specific use-case in mind which was to eliminate the need
for Veil to re-implement b64_encode and b64_decode, so I took the path
of least effort.

> >  > The patch was made against CVS head today.  It compiles and tests
> >  > successfully.  Though I was unable to run pgrypto regression tests, I
> >  > did give the b64 encoding a sanity check.
> >  >
> >  > I also added a b64_char() function that is now used from pgcrypto.  This
> >  > allowed me to remove the duplicate _base64 character array.
>
> I think this can be avoided by using plain b64_encode() for those 3 bytes.
> That step is really not speed critical.

You are probably right: I was being somewhat timid and tried to make the
smallest set of changes that were possible.

Unfortunately I don't have the time right now to revisit the patch.  If
you or anyone else would like to re-implement it as you suggest I will
still be a happy camper.   If not, Veil has already re-implemented the
functions, for compatibility with current and older versions of
postgres, so I can live with that too.

Thanks very much for looking at it.  To be honest, I thought that it had
got lost in the transition to the new improved patch process so I was
expecting to have to resubmit it later when I have more time.  Kudos to
Bruce for tracking it down.

__
Marc

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PLUGINS Functionlity in Win32 build scripts
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: questions for the patch 'Enable pl/python to return records based on multiple OUT params' during reviewing