1. 12 Jun, 2003 1 commit
    • Bruce Momjian's avatar
      I found the libpq function PGunescapeBytea a little slow. It was taking a · 4e1f9860
      Bruce Momjian authored
      minute and a half to decode a 500Kb on a fairly fast machine. I think the
      culprit is sscanf.
      
      I attach a patch that replaces the function with one used to perform the same
      task in pyPgSQL (a Python interface to PostgreSQL). This code was written by
      Billy Allie, author of pyPgSQL. I've changed a few variable names to match
      those in the original code and removed a bit of Pythonness.
      
      Billy has kindly looked at the code and points out that it is slightly
      stricter than the original implementation and if it encounters an invalid
      bytea such as '\12C' it drops the unescape '\' and outputs '12C'.
      
      The code is licensed by the author under a BSD license.
      
      I've performed limited testing of the function by putting JPEGs into
      PostgreSQL, extracting them using them using the new function and diffing
      against the original files.
      
      The new function is significantly faster on my machine with the JPEGs being
      decoded in less than a second. I attach a modified libpq example program that
      I used for my testing.
      
      Ben Lamb.
      4e1f9860
  2. 11 Jun, 2003 22 commits
  3. 10 Jun, 2003 2 commits
  4. 09 Jun, 2003 2 commits
  5. 08 Jun, 2003 1 commit
  6. 07 Jun, 2003 2 commits
  7. 06 Jun, 2003 10 commits