1. 18 Apr, 2011 4 commits
  2. 17 Apr, 2011 6 commits
    • Tom Lane's avatar
      Fix assorted infelicities in collation handling in psql's describe.c. · c29abc8b
      Tom Lane authored
      In \d, be more careful to print collation only if it's not the default for
      the column's data type.  Avoid assuming that the name "default" is magic.
      
      Fix \d on a composite type so that it will print per-column collations.
      It's no longer the case that a composite type cannot have modifiers.
      (In consequence, the expected outputs for composite-type regression tests
      change.)
      
      Fix \dD so that it will print collation for a domain, again only if it's
      not the same as the base type's collation.
      c29abc8b
    • Tom Lane's avatar
      Document COLLATE option in CREATE TYPE reference page. · 2d461712
      Tom Lane authored
      Curiously, it was already documented in ALTER TYPE ADD ATTRIBUTE, but
      not here.
      2d461712
    • Tom Lane's avatar
      Fix pg_dump to handle collations applied to columns of composite types. · acfa1f45
      Tom Lane authored
      CREATE TYPE and ALTER TYPE ADD ATTRIBUTE handle this, so I suppose it's
      an intended feature, but pg_dump didn't know about it.
      acfa1f45
    • Tom Lane's avatar
      Add check for matching column collations in ALTER TABLE ... INHERIT. · 49a642ab
      Tom Lane authored
      The other DDL operations that create an inheritance relationship were
      checking for collation match already, but this one got missed.
      
      Also fix comments that failed to mention collation checks.
      49a642ab
    • Tom Lane's avatar
      Support a COLLATE clause in plpgsql variable declarations. · c9473258
      Tom Lane authored
      This allows the usual rules for assigning a collation to a local variable
      to be overridden.  Per discussion, it seems appropriate to support this
      rather than forcing all local variables to have the argument-derived
      collation.
      c9473258
    • Tom Lane's avatar
      foreach() and list_delete() don't mix. · 88dc6fa7
      Tom Lane authored
      Fix crash when releasing duplicate entries in the encoding conversion cache
      list, caused by releasing the current entry of the list being chased by
      foreach().  We have a standard idiom for handling such cases, but this
      loop wasn't using it.
      
      This got broken in my recent rewrite of GUC assign hooks.  Not sure how
      I missed this when testing the modified code, but I did.  Per report from
      Peter.
      88dc6fa7
  3. 16 Apr, 2011 5 commits
    • Tom Lane's avatar
      Add an Assert that indexam.c isn't used on an index awaiting reindexing. · d2f60a3a
      Tom Lane authored
      This might have caught the recent embarrassment over trying to modify
      pg_index while its indexes were being rebuilt.
      
      Noah Misch
      d2f60a3a
    • Tom Lane's avatar
      Simplify reindex_relation's API. · 2d3320d3
      Tom Lane authored
      For what seem entirely historical reasons, a bitmask "flags" argument was
      recently added to reindex_relation without subsuming its existing boolean
      argument into that bitmask.  This seems a bit bizarre, so fold them
      together.
      2d3320d3
    • Tom Lane's avatar
      Clean up collation processing in prepunion.c. · 121f49a0
      Tom Lane authored
      This area was a few bricks shy of a load, and badly under-commented too.
      We have to ensure that the generated targetlist entries for a set-operation
      node expose the correct collation for each entry, since higher-level
      processing expects the tlist to reflect the true ordering of the plan's
      output.
      
      This hackery wouldn't be necessary if SortGroupClause carried collation
      info ... but making it do so would inject more pain in the parser than
      would be saved here.  Still, we might want to rethink that sometime.
      121f49a0
    • Peter Eisentraut's avatar
      Set client encoding explicitly in plpython_unicode test · 5809a645
      Peter Eisentraut authored
      This will (hopefully) eliminate the need for the
      plpython_unicode_0.out expected file.
      5809a645
    • Tom Lane's avatar
      Prevent incorrect updates of pg_index while reindexing pg_index itself. · 4b6106cc
      Tom Lane authored
      The places that attempt to change pg_index.indcheckxmin during a reindexing
      operation cannot be executed safely if pg_index itself is the subject of
      the operation.  This is the explanation for a couple of recent reports of
      VACUUM FULL failing with
      	ERROR:  duplicate key value violates unique constraint "pg_index_indexrelid_index"
      	DETAIL:  Key (indexrelid)=(2678) already exists.
      
      However, there isn't any real need to update indcheckxmin in such a
      situation, if we assume that pg_index can never contain a truly broken HOT
      chain.  This assumption holds if new indexes are never created on it during
      concurrent operations, which is something we don't consider safe for any
      system catalog, not just pg_index.  Accordingly, modify the code to not
      manipulate indcheckxmin when reindexing any system catalog.
      
      Back-patch to 8.3, where HOT was introduced.  The known failure scenarios
      involve 9.0-style VACUUM FULL, so there might not be any real risk before
      9.0, but let's not assume that.
      4b6106cc
  4. 15 Apr, 2011 8 commits
  5. 14 Apr, 2011 4 commits
    • Tom Lane's avatar
    • Robert Haas's avatar
      Advise Debian/Ubuntu users to use openjade1.3. · 07e58cbe
      Robert Haas authored
      The latest openjade packages for Ubuntu 10.10 seg fault when building
      our documentation.
      
      Josh Berkus
      07e58cbe
    • Robert Haas's avatar
      Remove obsolete comment. · 0c80b57d
      Robert Haas authored
      The lock level for adding a parent table is now ShareUpdateExclusiveLock;
      see commit fbcf4b92.  This comment didn't
      get updated to match, but it doesn't seem important to mention this detail
      here, so rather than updating it now, just take it out.
      0c80b57d
    • Robert Haas's avatar
      Fix toast table creation. · 39a68e5c
      Robert Haas authored
      Instead of using slightly-too-clever heuristics to decide when we must
      create a TOAST table, just check whether one is needed every time the
      table is altered.  Checking whether a toast table is needed is cheap
      enough that we needn't worry about doing it on every ALTER TABLE command,
      and the previous coding is apparently prone to accidental breakage:
      commit 04e17bae broken ALTER TABLE ..
      SET STORAGE, which moved some actions from AT_PASS_COL_ATTRS to
      AT_PASS_MISC, and commit 6c572399 broke
      ALTER TABLE .. ADD COLUMN by changing the way that adding columns
      recurses into child tables.
      
      Noah Misch, with one comment change by me
      39a68e5c
  6. 13 Apr, 2011 7 commits
  7. 12 Apr, 2011 4 commits
    • Tom Lane's avatar
      Pass collations to functions in FunctionCallInfoData, not FmgrInfo. · d64713df
      Tom Lane authored
      Since collation is effectively an argument, not a property of the function,
      FmgrInfo is really the wrong place for it; and this becomes critical in
      cases where a cached FmgrInfo is used for varying purposes that might need
      different collation settings.  Fix by passing it in FunctionCallInfoData
      instead.  In particular this allows a clean fix for bug #5970 (record_cmp
      not working).  This requires touching a bit more code than the original
      method, but nobody ever thought that collations would not be an invasive
      patch...
      d64713df
    • Tom Lane's avatar
      Suppress compiler warnings about "value computed is not used". · 88543ecf
      Tom Lane authored
      The recent patch to remove gcc 4.6 warnings created some new ones, at
      least on my rather old gcc version.  Try to make everybody happy by
      casting to "void" when we just want to discard the result.
      88543ecf
    • Tom Lane's avatar
      Be more wary of missing statistics in eqjoinsel_semi(). · 3f5d2fe3
      Tom Lane authored
      In particular, if we don't have real ndistinct estimates for both sides,
      fall back to assuming that half of the left-hand rows have join partners.
      This is what was done in 8.2 and 8.3 (cf nulltestsel() in those versions).
      It's pretty stupid but it won't lead us to think that an antijoin produces
      no rows out, as seen in recent example from Uwe Schroeder.
      3f5d2fe3
    • Tom Lane's avatar
      Fix RI_Initial_Check to use a COLLATE clause when needed in its query. · 921b9936
      Tom Lane authored
      If the referencing and referenced columns have different collations,
      the parser will be unable to resolve which collation to use unless it's
      helped out in this way.  The effects are sometimes masked, if we end up
      using a non-collation-sensitive plan; but if we do use a mergejoin
      we'll see a failure, as recently noted by Robert Haas.
      
      The SQL spec states that the referenced column's collation should be used
      to resolve RI checks, so that's what we do.  Note however that we currently
      don't append a COLLATE clause when writing a query that examines only the
      referencing column.  If we ever support collations that have varying
      notions of equality, that will have to be changed.  For the moment, though,
      it's preferable to leave it off so that we can use a normal index on the
      referencing column.
      921b9936
  8. 11 Apr, 2011 2 commits