1. 11 Sep, 2020 3 commits
  2. 10 Sep, 2020 11 commits
  3. 09 Sep, 2020 6 commits
  4. 08 Sep, 2020 8 commits
  5. 07 Sep, 2020 10 commits
  6. 06 Sep, 2020 2 commits
    • Tom Lane's avatar
      Remove arbitrary line length limits in pg_regress (plain and ECPG). · 784b1ba1
      Tom Lane authored
      Refactor replace_string() to use a StringInfo for the modifiable
      string argument.  This allows the string to be of indefinite size
      initially and/or grow substantially during replacement.  The previous
      logic in convert_sourcefiles_in() had a hard-wired limit of 1024
      bytes on any line in input/*.sql or output/*.out files.  While we've
      not had reports of trouble yet, it'd surely have bit us someday.
      
      This also fixes replace_string() so it won't get into an infinite
      loop if the string-to-be-replaced is a substring of the replacement.
      That's unlikely to happen in current usage, but the function surely
      shouldn't depend on it.
      
      Also fix ecpg_filter() to use a StringInfo and thereby remove its
      hard limit of 300 bytes on the length of an ecpg source line.
      
      Asim Rama Praveen and Georgios Kokolatos,
      reviewed by Alvaro Herrera and myself
      
      Discussion: https://postgr.es/m/y9Dlk2QhiZ39DhaB1QE9mgZ95HcOQKZCNtGwN7XCRKMdBRBnX_0woaRUtTjloEp4PKA6ERmcUcfq3lPGfKPOJ5xX2TV-5WoRYyySeNHRzdw=@protonmail.com
      784b1ba1
    • Tom Lane's avatar
      Refactor pg_get_line() to expose an alternative StringInfo-based API. · 8e3c58e6
      Tom Lane authored
      Letting the caller provide a StringInfo to read into is helpful when
      the caller needs to merge lines or otherwise modify the data after
      it's been read.  Notably, now the code added by commit 8f8154a5
      can use pg_get_line_append() instead of having its own copy of that
      logic.  A follow-on commit will also make use of this.
      
      Also, since StringInfo buffers are a minimum of 1KB long, blindly
      using pg_get_line() in a loop can eat a lot more memory than one would
      expect.  I discovered for instance that commit e0f05cd5 caused initdb
      to consume circa 10MB to read postgres.bki, even though that's under
      1MB worth of data.  A less memory-hungry alternative is to re-use the
      same StringInfo for all lines and pg_strdup the results.
      
      Discussion: https://postgr.es/m/1315832.1599345736@sss.pgh.pa.us
      8e3c58e6