1. 15 3月, 2013 1 次提交
    • H
      Also update psqlscan.l with the UESCAPE error rule changes. · f7559c01
      Heikki Linnakangas 提交于
      Even though this patch had no user-visible difference, better keep the code
      in psqlscan.l sync with the backend lexer. And of course it's nice to shrink
      the psql binary, too. Ecpg's version of the lexer doesn't have the error
      rule, it doesn't try to avoid backing up, so it doesn't need to be modified.
      
      As reminded by Tom Lane
      f7559c01
  2. 02 1月, 2013 1 次提交
  3. 15 12月, 2012 1 次提交
  4. 02 12月, 2012 1 次提交
  5. 03 10月, 2012 1 次提交
    • T
      Standardize naming of malloc/realloc/strdup wrapper functions. · a563d941
      Tom Lane 提交于
      We had a number of variants on the theme of "malloc or die", with the
      majority named like "pg_malloc", but by no means all.  Standardize on the
      names pg_malloc, pg_malloc0, pg_realloc, pg_strdup.  Get rid of pg_calloc
      entirely in favor of using pg_malloc0.
      
      This is an essentially cosmetic change, so no back-patch.  (I did find
      a couple of places where psql and pg_dump were using plain malloc or
      strdup instead of the pg_ versions, but they don't look significant
      enough to bother back-patching.)
      a563d941
  6. 22 3月, 2012 1 次提交
  7. 02 1月, 2012 1 次提交
  8. 19 10月, 2011 1 次提交
  9. 27 8月, 2011 2 次提交
    • T
      Clean up weird corner cases in lexing of psql meta-command arguments. · 928311a4
      Tom Lane 提交于
      These changes allow backtick command evaluation and psql variable
      interpolation to happen on substrings of a single meta-command argument.
      Formerly, no such evaluations happened at all if the backtick or colon
      wasn't the first character of the argument, and we considered an argument
      completed as soon as we'd processed one backtick, variable reference, or
      quoted substring.  A string like 'FOO'BAR was thus taken as two arguments
      not one, not exactly what one would expect.  In the new coding, an argument
      is considered terminated only by unquoted whitespace or backslash.
      
      Also, clean up a bunch of omissions, infelicities and outright errors in
      the psql documentation of variables and metacommand argument syntax.
      928311a4
    • T
      Support non-ASCII letters in psql variable names. · e86fdb0a
      Tom Lane 提交于
      As in the backend, the implementation actually accepts any non-ASCII
      character, but we only document that you can use letters.
      e86fdb0a
  10. 26 8月, 2011 2 次提交
    • T
      Fix psql lexer to avoid use of backtracking. · 77ce50a4
      Tom Lane 提交于
      Per previous experimentation, backtracking slows down lexing performance
      significantly (by about a third).  It's usually pretty easy to avoid, just
      need to have rules that accept an incomplete construct and do whatever the
      lexer would have done otherwise.
      
      The backtracking was introduced by the patch that added quoted variable
      substitution.  Back-patch to 9.0 where that was added.
      77ce50a4
    • T
      Add "%option warn" to all flex input files that lacked it. · 2e95f1f0
      Tom Lane 提交于
      This is recommended in the flex manual, and there seems no good reason
      not to use it everywhere.
      2e95f1f0
  11. 12 4月, 2011 1 次提交
  12. 02 1月, 2011 1 次提交
  13. 24 11月, 2010 1 次提交
  14. 27 10月, 2010 1 次提交
  15. 21 9月, 2010 1 次提交
  16. 31 5月, 2010 1 次提交
    • T
      Change the notation for calling functions with named parameters from · b12b7a90
      Tom Lane 提交于
      "val AS name" to "name := val", as per recent discussion.
      
      This patch catches everything in the original named-parameters patch,
      but I'm not certain that no other dependencies snuck in later (grepping
      the source tree for all uses of AS soon proved unworkable).
      
      In passing I note that we've dropped the ball at least once on keeping
      ecpg's lexer (as opposed to parser) in sync with the backend.  It would
      be a good idea to go through all of pgc.l and see if it's in sync now.
      I didn't attempt that at the moment.
      b12b7a90
  17. 06 5月, 2010 1 次提交
    • T
      Fix psql to not go into infinite recursion when expanding a variable that · 93dc6a1b
      Tom Lane 提交于
      refers to itself (directly or indirectly).  Instead, print a message when
      recursion is detected, and don't expand the repeated reference.  Per bug
      #5448 from Francis Markham.
      
      Back-patch to 8.0.  Although the issue exists in 7.4 as well, it seems
      impractical to fix there because of the lack of any state stack that
      could be used to track active expansions.
      93dc6a1b
  18. 30 1月, 2010 1 次提交
  19. 03 1月, 2010 1 次提交
  20. 12 11月, 2009 1 次提交
    • T
      Remove plpgsql's separate lexer (finally!), in favor of using the core lexer · 2dee828c
      Tom Lane 提交于
      directly.  This was a lot of trouble, but should be worth it in terms of
      not having to keep the plpgsql lexer in step with core anymore.  In addition
      the handling of keywords is significantly better-structured, allowing us to
      de-reserve a number of words that plpgsql formerly treated as reserved.
      2dee828c
  21. 27 9月, 2009 1 次提交
  22. 02 1月, 2009 1 次提交
  23. 26 11月, 2008 1 次提交
    • T
      Adjust the behavior of the PQExpBuffer code to make it have well-defined · 739259d6
      Tom Lane 提交于
      results (ie, an empty "broken" buffer) if memory overrun occurs anywhere
      along the way to filling the buffer.  The previous coding would just silently
      discard portions of the intended buffer contents, as exhibited in trouble
      report from Sam Mason.  Also, tweak psql's main loop to correctly detect
      and report such overruns.  There's probably much more that should be done
      in this line, but this is a start.
      739259d6
  24. 29 10月, 2008 1 次提交
  25. 09 5月, 2008 1 次提交
  26. 02 5月, 2008 1 次提交
  27. 02 1月, 2008 1 次提交
  28. 14 10月, 2007 1 次提交
    • T
      Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: the · 8468146b
      Tom Lane 提交于
      renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2
      initdb and psql if they are run with an 8.3beta1 libpq.so.  For the moment
      we can rearrange the order of enum pg_enc to keep the same number for
      everything except PG_JOHAB, which isn't a problem since there are no direct
      references to it in the 8.2 programs anyway.  (This does force initdb
      unfortunately.)
      
      Going forward, we want to fix things so that encoding IDs can be changed
      without an ABI break, and this commit includes the changes needed to allow
      libpq's encoding IDs to be treated as fully independent of the backend's.
      The main issue is that libpq clients should not include pg_wchar.h or
      otherwise assume they know the specific values of libpq's encoding IDs,
      since they might encounter version skew between pg_wchar.h and the libpq.so
      they are using.  To fix, have libpq officially export functions needed for
      encoding name<=>ID conversion and validity checking; it was doing this
      anyway unofficially.
      
      It's still the case that we can't renumber backend encoding IDs until the
      next bump in libpq's major version number, since doing so will break the
      8.2-era client programs.  However the code is now prepared to avoid this
      type of problem in future.
      
      Note that initdb is no longer a libpq client: we just pull in the two
      source files we need directly.  The patch also fixes a few places that
      were being sloppy about checking for an unrecognized encoding name.
      8468146b
  29. 06 1月, 2007 1 次提交
  30. 01 6月, 2006 1 次提交
  31. 31 5月, 2006 1 次提交
  32. 12 5月, 2006 1 次提交
  33. 07 3月, 2006 1 次提交
  34. 05 3月, 2006 1 次提交
  35. 27 6月, 2005 1 次提交
    • T
      Code review for escape-strings patch. Sync psql and plpgsql lexers · d395aecf
      Tom Lane 提交于
      with main, avoid using a SQL-defined SQLSTATE for what is most definitely
      not a SQL-compatible error condition, fix documentation omissions,
      adhere to message style guidelines, don't use two GUC_REPORT variables
      when one is sufficient.  Nothing done about pg_dump issues.
      d395aecf
  36. 03 6月, 2005 1 次提交
  37. 02 6月, 2005 1 次提交
  38. 31 5月, 2005 1 次提交