1. 29 May, 2013 3 commits
  2. 27 May, 2013 1 commit
    • Stephen Frost's avatar
      Documentation fix for ALTER TYPE .. RENAME · 05624220
      Stephen Frost authored
      The documentation for ALTER TYPE .. RENAME claimed to support a
      RESTRICT/CASCADE option at the 'type' level, which wasn't implemented
      and doesn't make a whole lot of sense to begin with.  What is supported,
      and previously undocumented, is
      
      ALTER TYPE .. RENAME ATTRIBUTE .. RESTRICT/CASCADE.
      
      I've updated the documentation and back-patched this to 9.1 where it was
      first introduced.
      05624220
  3. 24 May, 2013 1 commit
  4. 23 May, 2013 2 commits
    • Robert Haas's avatar
      Fix typo in comment. · 6eb971bd
      Robert Haas authored
      Pavan Deolasee
      6eb971bd
    • Heikki Linnakangas's avatar
      Print line number correctly in COPY. · e2ef2893
      Heikki Linnakangas authored
      When COPY uses the multi-insert method to insert a batch of tuples into the
      heap at a time, incorrect line number was printed if something went wrong in
      inserting the index tuples (primary key failure, for exampl), or processing
      after row triggers.
      
      Fixes bug #8173 reported by Lloyd Albin. Backpatch to 9.2, where the multi-
      insert code was added.
      e2ef2893
  5. 21 May, 2013 6 commits
  6. 20 May, 2013 2 commits
    • Heikki Linnakangas's avatar
      Fix escaping in generated recovery.conf file. · 30b5ede7
      Heikki Linnakangas authored
      In the primary_conninfo line that "pg_basebackup -R" generates, single
      quotes in parameter values need to be escaped into \\'; the libpq parser
      requires the quotes to be escaped into \', and recovery.conf parser requires
      the \ to be escaped into \\.
      
      Also, don't quote parameter values unnecessarily, to make the connection
      string prettier. Most options in a libpq connection string don't need
      quoting.
      
      Reported by Hari Babu, closer analysis by Zoltan Boszormenyi, although I
      didn't use his patch.
      30b5ede7
    • Tom Lane's avatar
      Clarify documentation of EXPLAIN (TIMING OFF) option. · 2af0971f
      Tom Lane authored
      Clarify that this option doesn't suppress measurement of the statement's
      total runtime.
      
      Greg Smith
      2af0971f
  7. 19 May, 2013 3 commits
  8. 18 May, 2013 2 commits
  9. 16 May, 2013 3 commits
    • Tom Lane's avatar
      Fix crash when trying to display a NOTIFY rule action. · 403bd6a1
      Tom Lane authored
      Fixes oversight in commit 2ffa740b.
      Per report from Josh Kupershmidt.
      
      I think we've broken this case before, so let's add a regression test
      this time.
      403bd6a1
    • Tom Lane's avatar
      Fix fd.c to preserve errno where needed. · 6563fb2b
      Tom Lane authored
      PathNameOpenFile failed to ensure that the correct value of errno was
      returned to its caller after a failure (because it incorrectly supposed
      that free() can never change errno).  In some cases this would result
      in a user-visible failure because an expected ENOENT errno was replaced
      with something else.  Bogus EINVAL failures have been observed on OS X,
      for example.
      
      There were also a couple of places that could mangle an important value
      of errno if FDDEBUG was defined.  While the usefulness of that debug
      support is highly debatable, we might as well make it safe to use,
      so add errno save/restore logic to the DO_DB macro.
      
      Per bug #8167 from Nelson Minar, diagnosed by RhodiumToad.
      Back-patch to all supported branches.
      6563fb2b
    • Tom Lane's avatar
      Fix some uses of "the quick brown fox". · e7bfc7e4
      Tom Lane authored
      If we're going to quote a well-known pangram, we should quote it
      accurately.  Per gripe from Thom Brown.
      e7bfc7e4
  10. 15 May, 2013 2 commits
    • Tom Lane's avatar
      Allow CREATE FOREIGN TABLE to include SERIAL columns. · b1420686
      Tom Lane authored
      The behavior is that the required sequence is created locally, which is
      appropriate because the default expression will be evaluated locally.
      Per gripe from Brad Nicholson that this case was refused with a confusing
      error message.  We could have improved the error message but it seems
      better to just allow the case.
      
      Also, remove ALTER TABLE's arbitrary prohibition against being applied to
      foreign tables, which was pretty inconsistent considering we allow it for
      views, sequences, and other relation types that aren't even called tables.
      This is needed to avoid breaking pg_dump, which sometimes emits column
      defaults using separate ALTER TABLE commands.  (I think this can happen
      even when the default is not associated with a sequence, so that was a
      pre-existing bug once we allowed column defaults for foreign tables.)
      b1420686
    • Peter Eisentraut's avatar
      doc: Add \dm command to psql man page · a2a480af
      Peter Eisentraut authored
      a2a480af
  11. 14 May, 2013 3 commits
  12. 13 May, 2013 1 commit
    • Tom Lane's avatar
      Fix handling of OID wraparound while in standalone mode. · e9c336c7
      Tom Lane authored
      If OID wraparound should occur while in standalone mode (unlikely but
      possible), we want to advance the counter to FirstNormalObjectId not
      FirstBootstrapObjectId.  Otherwise, user objects might be created with OIDs
      in the system-reserved range.  That isn't immediately harmful but it poses
      a risk of conflicts during future pg_upgrade operations.
      
      Noted by Andres Freund.  Back-patch to all supported branches, since all of
      them are supported sources for pg_upgrade operations.
      e9c336c7
  13. 12 May, 2013 3 commits
    • Tom Lane's avatar
      Fix handling of strict non-set functions with NULLs in set-valued inputs. · 904af8db
      Tom Lane authored
      In a construct like "select plain_function(set_returning_function(...))",
      the plain function is applied to each output row of the SRF successively.
      If some of the SRF outputs are NULL, and the plain function is strict,
      you'd expect to get NULL results for such rows ... but what actually
      happened was that such rows were omitted entirely from the result set.
      This was due to confusion of this case with what should happen for nested
      set-returning functions; a strict SRF is indeed supposed to yield an empty
      set for null input.  Per bug #8150 from Erwin Brandstetter.
      
      Although this has been broken forever, we're not back-patching because
      of the possibility that some apps out there expect the incorrect behavior.
      This change should be listed as a possible incompatibility in the 9.3
      release notes.
      904af8db
    • Peter Eisentraut's avatar
      f0ed3a8a
    • Peter Eisentraut's avatar
      pg_xlogdump: Improve --help output · a4fd3366
      Peter Eisentraut authored
      a4fd3366
  14. 11 May, 2013 4 commits
    • Tom Lane's avatar
      Fix to_number() to correctly ignore thousands separator when it's '.'. · 35d50b52
      Tom Lane authored
      The existing code in NUM_numpart_from_char has hard-wired logic to treat
      '.' as decimal point, even when we're using a locale-aware format string
      and the locale says that '.' is the thousands separator.  This results in
      clearly wrong answers in FM mode (where we must be able to identify the
      decimal point location), as per bug report from Patryk Kordylewski.
      
      Since the initialization code in NUM_prepare_locale already sets up
      Np->decimal as either the locale decimal-point string or "." depending
      on which decimal-point format code was used, there's really no need to
      have any extra logic at all in NUM_numpart_from_char: we only need to
      test for a match to Np->decimal.
      
      (Note: AFAICS there's nothing in here that explicitly checks for thousands
      separators --- rather, any unmatched character is silently skipped over.
      That's pretty bogus IMO but it's not the issue being complained of.)
      
      This is a longstanding bug, but it's possible that some existing apps
      are depending on '.' being recognized as decimal point even when using
      a D format code.  Hence, no back-patch.  We should probably list this
      as a potential incompatibility in the 9.3 release notes.
      35d50b52
    • Tom Lane's avatar
      Fix buildfarm incompatibility in updated pg_upgrade test script. · 8cade04c
      Tom Lane authored
      Looks like some versions of the buildfarm script try to set the port via
      --port in $EXTRA_REGRESS_OPTS.  Override that ...
      8cade04c
    • Tom Lane's avatar
      Make pg_upgrade's test script attempt to select a non-conflicting port. · 7e2b1c03
      Tom Lane authored
      Previously, the port number used in this test script was hard-wired at
      pg_upgrade's default of 50432; which is not so great because parallel build
      runs might conflict.  Commit 3d53173e
      removed this setting for the postmasters started by the script proper
      (not by pg_upgrade), which didn't do anything to fix that problem and also
      guaranteed a failure if there was a live postmaster at the build's default
      port number.  Instead, select a non-conflicting temporary port number in
      the same way that pg_regress.c does.  (Its method isn't entirely
      bulletproof, but given the lack of complaints I'm not going to worry
      about that today.)
      
      In passing, unset MAKEFLAGS and MAKELEVEL to avoid problems with the
      script's internal invocations of make, for the same reason pg_regress.c
      does: it could cause problems in a parallel make.
      7e2b1c03
    • Tom Lane's avatar
      Update CREATE FUNCTION documentation about argument names. · c263f16a
      Tom Lane authored
      The 9.2 patch that added argument name support in SQL-language functions
      missed updating a parenthetical comment about that in the CREATE FUNCTION
      reference page.  Noted by Erwin Brandstetter.
      c263f16a
  15. 10 May, 2013 4 commits
    • Tom Lane's avatar
      Guard against input_rows == 0 in estimate_num_groups(). · 69cc60dc
      Tom Lane authored
      This case doesn't normally happen, because the planner usually clamps
      all row estimates to at least one row; but I found that it can arise
      when dealing with relations excluded by constraints.  Without a defense,
      estimate_num_groups() can return zero, which leads to divisions by zero
      inside the planner as well as assertion failures in the executor.
      
      An alternative fix would be to change set_dummy_rel_pathlist() to make
      the size estimate for a dummy relation 1 row instead of 0, but that seemed
      pretty ugly; and probably someday we'll want to drop the convention that
      the minimum rowcount estimate is 1 row.
      
      Back-patch to 8.4, as the problem can be demonstrated that far back.
      69cc60dc
    • Tom Lane's avatar
      Fix pgp_pub_decrypt() so it works for secret keys with passwords. · 477b5a0e
      Tom Lane authored
      Per report from Keith Fiske.
      
      Marko Kreen
      477b5a0e
    • Tom Lane's avatar
      Fix management of fn_extra caching during repeated GiST index scans. · 91715e82
      Tom Lane authored
      Commit d22a09dc introduced official support
      for GiST consistentFns that want to cache data using the FmgrInfo fn_extra
      pointer: the idea was to preserve the cached values across gistrescan(),
      whereas formerly they'd been leaked.  However, there was an oversight in
      that, namely that multiple scan keys might reference the same column's
      consistentFn; the code would result in propagating the same cache value
      into multiple scan keys, resulting in crashes or wrong answers.  Use a
      separate array instead to ensure that each scan key keeps its own state.
      
      Per bug #8143 from Joel Roller.  Back-patch to 9.2 where the bug was
      introduced.
      91715e82
    • Peter Eisentraut's avatar
      Update key words table for 9.3 · cda7acee
      Peter Eisentraut authored
      cda7acee