1. 31 Jan, 2017 2 commits
    • Stephen Frost's avatar
      perltidy pg_dump TAP tests · 6af8b89a
      Stephen Frost authored
      The pg_dump TAP tests have gotten pretty far from what perltidy thinks
      they should be, so fix that, and in passing use long-form argument names
      with arguments passed via "=" in a similar vein to 58da8334.
      
      No functional changes here, just whitespace and changing runs from
      "-f" to "--file=", and similar.
      6af8b89a
    • Stephen Frost's avatar
      test_pg_dump: perltidy cleanup · 58da8334
      Stephen Frost authored
      As pointed out by Alvaro, we actually use perltidy on the perl scripts
      in the source tree, so go back to the results of a perltidy run for the
      test_pg_dump TAP script.
      
      To make it look slightly less tragic, I changed most of the independent
      arguments into long-form single arguments (eg: -f file.sql changed to be
      --file=file.sql) to avoid having them confusingly split across lines due
      to perltidy.
      
      Back-patch to 9.6, as the last patch was.
      58da8334
  2. 30 Jan, 2017 10 commits
    • Tom Lane's avatar
      Simplify some long-obsolete code in hba.c's next_token(). · 1e5a5d03
      Tom Lane authored
      next_token() oddly set its buffer space consumption limit to one before
      the last char position in the buffer, not the last as you'd expect.
      The reason is there was once an ugly kluge to mark keywords by appending
      a newline to them, potentially requiring one more byte.  Commit e5e2fc84
      removed that kluge, but failed to notice that the length limit could be
      increased.
      
      Also, remove some vestigial handling of newline characters in the buffer.
      That was left over from when this function read the file directly using
      getc().  Commit 7f49a67f changed it to read from a buffer, from which
      tokenize_file had already removed the only possible occurrence of newline,
      but did not simplify this function in consequence.
      
      Also, ensure that we don't return with *lineptr set to someplace past the
      terminating '\0'; that would be catastrophic if a caller were to ask for
      another token from the same line.  This is just latent since no callers
      actually do call again after a "false" return; but considering that it was
      actually costing us extra code to do it wrong, we might as well make it
      bulletproof.
      
      Noted while reviewing pg_hba_file_rules patch.
      1e5a5d03
    • Tom Lane's avatar
      Invent pg_hba_file_rules view to show the content of pg_hba.conf. · de16ab72
      Tom Lane authored
      This view is designed along the same lines as pg_file_settings, to wit
      it shows what is currently in the file, not what the postmaster has
      loaded as the active settings.  That allows it to be used to pre-vet
      edits before issuing SIGHUP.  As with the earlier view, go out of our
      way to allow errors in the file to be reflected in the view, to assist
      that use-case.
      
      (We might at some point invent a view to show the current active settings,
      but this is not that patch; and it's not trivial to do.)
      
      Haribabu Kommi, reviewed by Ashutosh Bapat, Michael Paquier, Simon Riggs,
      and myself
      
      Discussion: https://postgr.es/m/CAJrrPGerH4jiwpcXT1-46QXUDmNp2QDrG9+-Tek_xC8APHShYw@mail.gmail.com
      de16ab72
    • Tom Lane's avatar
      Add a regression test script dedicated to exercising system views. · d002f16c
      Tom Lane authored
      Quite a few of our built-in system views were not exercised anywhere
      in the regression tests.  This is perhaps not so exciting for the ones
      that are simple projections/joins of system catalogs, but for the ones
      that are wrappers for set-returning C functions, the omission translates
      directly to lack of test coverage for those functions.
      
      In many cases, the reason for the omission is that the view doesn't have
      much to do with any specific SQL feature, so there's no natural place to
      test it.  To remedy that, invent a new script sysviews.sql that's dedicated
      to testing SRF-based views.  Move a couple of tests that did fit this
      charter into the new script, and add simple "count(*)" based tests of
      other views within the charter.  That's enough to ensure we at least
      exercise the main code path through the SRF, although it does little to
      prove that the output is sane.
      
      More could be done here, no doubt, and I hope someone will think about
      how we can test these views more thoroughly.  But this is a starting
      point.
      
      Discussion: https://postgr.es/m/19359.1485723741@sss.pgh.pa.us
      d002f16c
    • Tom Lane's avatar
      Make psql reject attempts to set special variables to invalid values. · 511ae628
      Tom Lane authored
      Previously, if the user set a special variable such as ECHO to an
      unrecognized value, psql would bleat but store the new value anyway, and
      then fall back to a default setting for the behavior controlled by the
      variable.  This was agreed to be a not particularly good idea.  With
      this patch, invalid values result in an error message and no change in
      state.
      
      (But this applies only to variables that affect psql's behavior; purely
      informational variables such as ENCODING can still be set to random
      values.)
      
      To do this, modify the API for psql's assign-hook functions so that they
      can return an OK/not OK result, and give them the responsibility for
      printing error messages when they reject a value.  Adjust the APIs for
      ParseVariableBool and ParseVariableNum to support the new behavior
      conveniently.
      
      In passing, document the variable VERSION, which had somehow escaped that.
      And improve the quite-inadequate commenting in psql/variables.c.
      
      Daniel Vérité, reviewed by Rahila Syed, some further tweaking by me
      
      Discussion: https://postgr.es/m/7356e741-fa59-4146-a8eb-cf95fd6b21fb@mm
      511ae628
    • Peter Eisentraut's avatar
      Fix sequence test in cs_CZ locale · 46aae594
      Peter Eisentraut authored
      Rename some objects so that sorted output becomes less locale-dependent.
      46aae594
    • Peter Eisentraut's avatar
      d711532b
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016j. · 308d8682
      Tom Lane authored
      DST law changes in northern Cyprus (new zone Asia/Famagusta), Russia (new
      zone Europe/Saratov), Tonga, Antarctica/Casey.  Historical corrections for
      Asia/Aqtau, Asia/Atyrau, Asia/Gaza, Asia/Hebron, Italy, Malta.  Replace
      invented zone abbreviation "TOT" for Tonga with numeric UTC offset; but
      as in the past, we'll keep accepting "TOT" for input.
      308d8682
    • Heikki Linnakangas's avatar
      Remove leftover reference to "indirect blocks" in comment. · dbeca61c
      Heikki Linnakangas authored
      Peter Geoghegan
      dbeca61c
    • Stephen Frost's avatar
      Handle ALTER EXTENSION ADD/DROP with pg_init_privs · e54f7572
      Stephen Frost authored
      In commit 6c268df1, pg_init_privs was added to track the initial
      privileges of catalog objects and extensions.  Unfortunately, that
      commit didn't include understanding of ALTER EXTENSION ADD/DROP, which
      allows the objects associated with an extension to be changed after the
      initial CREATE EXTENSION script has been run.
      
      The result of this meant that ACLs for objects added through
      ALTER EXTENSION ADD were not recorded into pg_init_privs and we would
      end up including those ACLs in pg_dump when we shouldn't have.
      
      This commit corrects that by making sure to have pg_init_privs updated
      when ALTER EXTENSION ADD/DROP is run, recording the permissions as they
      are at ALTER EXTENSION ADD time, and removing any if/when ALTER
      EXTENSION DROP is called.
      
      This issue was pointed out by Moshe Jacobson as commentary on bug #14456
      (which was actually a bug about versions prior to 9.6 not handling
      custom ACLs on extensions correctly, an issue now addressed with
      pg_init_privs in 9.6).
      
      Back-patch to 9.6 where pg_init_privs was introduced.
      e54f7572
    • Stephen Frost's avatar
      test_pg_dump TAP test whitespace cleanup · fb94ca77
      Stephen Frost authored
      The formatting of the perl hashes used in the TAP tests for test_pg_dump
      was rather horribly inconsistent and made it more difficult than it
      really should have been to add new tests or adjust what tests are for
      what runs, etc.
      
      Reformat to clean that all up.
      
      Whitespace-only changes.
      fb94ca77
  3. 27 Jan, 2017 8 commits
  4. 26 Jan, 2017 9 commits
  5. 25 Jan, 2017 11 commits