1. 10 2月, 2011 2 次提交
  2. 09 2月, 2011 3 次提交
    • T
      Core support for "extensions", which are packages of SQL objects. · d9572c4e
      Tom Lane 提交于
      This patch adds the server infrastructure to support extensions.
      There is still one significant loose end, namely how to make it play nice
      with pg_upgrade, so I am not yet committing the changes that would make
      all the contrib modules depend on this feature.
      
      In passing, fix a disturbingly large amount of breakage in
      AlterObjectNamespace() and callers.
      
      Dimitri Fontaine, reviewed by Anssi Kääriäinen,
      Itagaki Takahiro, Tom Lane, and numerous others
      d9572c4e
    • P
      Per-column collation support · 414c5a2e
      Peter Eisentraut 提交于
      This adds collation support for columns and domains, a COLLATE clause
      to override it per expression, and B-tree index support.
      
      Peter Eisentraut
      reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
      414c5a2e
    • S
  3. 08 2月, 2011 1 次提交
  4. 02 2月, 2011 1 次提交
  5. 26 1月, 2011 1 次提交
    • T
      Replace pg_class.relhasexclusion with pg_index.indisexclusion. · bd1ad1b0
      Tom Lane 提交于
      There isn't any need to track this state on a table-wide basis, and trying
      to do so introduces undesirable semantic fuzziness.  Move the flag to
      pg_index, where it clearly describes just a single index and can be
      immutable after index creation.
      bd1ad1b0
  6. 12 1月, 2011 1 次提交
  7. 09 1月, 2011 1 次提交
    • T
      Remove pg_am.amindexnulls. · 7e2f9062
      Tom Lane 提交于
      The only use we have had for amindexnulls is in determining whether an
      index is safe to cluster on; but since the addition of the amclusterable
      flag, that usage is pretty redundant.
      
      In passing, clean up assorted sloppiness from the last patch that touched
      pg_am.h: Natts_pg_am was wrong, and ambuildempty was not documented.
      7e2f9062
  8. 08 1月, 2011 1 次提交
  9. 05 1月, 2011 1 次提交
    • M
      Give superusers REPLIACTION permission by default · 66a8a042
      Magnus Hagander 提交于
      This can be overriden by using NOREPLICATION on the CREATE ROLE
      statement, but by default they will have it, making it backwards
      compatible and "less surprising" (given that superusers normally
      override all checks).
      66a8a042
  10. 03 1月, 2011 1 次提交
  11. 02 1月, 2011 3 次提交
    • P
      Implement remaining fields of information_schema.sequences view · 39b88432
      Peter Eisentraut 提交于
      Add new function pg_sequence_parameters that returns a sequence's start,
      minimum, maximum, increment, and cycle values, and use that in the view.
      (bug #5662; design suggestion by Tom Lane)
      
      Also slightly adjust the view's column order and permissions after review of
      SQL standard.
      39b88432
    • R
      Basic foreign table support. · 0d692a0d
      Robert Haas 提交于
      Foreign tables are a core component of SQL/MED.  This commit does
      not provide a working SQL/MED infrastructure, because foreign tables
      cannot yet be queried.  Support for foreign table scans will need to
      be added in a future patch.  However, this patch creates the necessary
      system catalog structure, syntax support, and support for ancillary
      operations such as COMMENT and SECURITY LABEL.
      
      Shigeru Hanada, heavily revised by Robert Haas
      0d692a0d
    • B
      Stamp copyrights for year 2011. · 5d950e3b
      Bruce Momjian 提交于
      5d950e3b
  12. 29 12月, 2010 1 次提交
    • R
      Support unlogged tables. · 53dbc27c
      Robert Haas 提交于
      The contents of an unlogged table are WAL-logged; thus, they are not
      available on standby servers and are truncated whenever the database
      system enters recovery.  Indexes on unlogged tables are also unlogged.
      Unlogged GiST indexes are not currently supported.
      53dbc27c
  13. 28 12月, 2010 1 次提交
    • T
      Rename the C functions bitand(), bitor() to bit_and(), bit_or(). · 84fc5713
      Tom Lane 提交于
      This is to avoid use of the C++ keywords "bitand" and "bitor" in
      the header file utils/varbit.h.  Note the functions' SQL-level
      names are not changed, only their C-level names.
      
      In passing, make some comments in varbit.c conform to project-standard
      layout.
      84fc5713
  14. 16 12月, 2010 1 次提交
  15. 14 12月, 2010 1 次提交
    • R
      Generalize concept of temporary relations to "relation persistence". · 5f7b58fa
      Robert Haas 提交于
      This commit replaces pg_class.relistemp with pg_class.relpersistence;
      and also modifies the RangeVar node type to carry relpersistence rather
      than istemp.  It also removes removes rd_istemp from RelationData and
      instead performs the correct computation based on relpersistence.
      
      For clarity, we add three new macros: RelationNeedsWAL(),
      RelationUsesLocalBuffers(), and RelationUsesTempNamespace(), so that we
      can clarify the purpose of each check that previous depended on
      rd_istemp.
      
      This is intended as infrastructure for the upcoming unlogged tables
      patch, as well as for future possible work on global temporary tables.
      5f7b58fa
  16. 04 12月, 2010 1 次提交
    • T
      KNNGIST, otherwise known as order-by-operator support for GIST. · 55450687
      Tom Lane 提交于
      This commit represents a rather heavily editorialized version of
      Teodor's builtin_knngist_itself-0.8.2 and builtin_knngist_proc-0.8.1
      patches.  I redid the opclass API to add a separate Distance method
      instead of turning the Consistent method into an illogical mess,
      fixed some bit-rot in the rbtree interfaces, and generally worked over
      the code style and comments.
      
      There's still no non-code documentation to speak of, but I'll work on
      that separately.  Some contrib-module changes are also yet to come
      (right now, point <-> point is the only KNN-ified operator).
      
      Teodor Sigaev and Tom Lane
      55450687
  17. 03 12月, 2010 1 次提交
    • T
      Create core infrastructure for KNNGIST. · d583f10b
      Tom Lane 提交于
      This is a heavily revised version of builtin_knngist_core-0.9.  The
      ordering operators are no longer mixed in with actual quals, which would
      have confused not only humans but significant parts of the planner.
      Instead, ordering operators are carried separately throughout planning and
      execution.
      
      Since the API for ambeginscan and amrescan functions had to be changed
      anyway, this commit takes the opportunity to rationalize that a bit.
      RelationGetIndexScan no longer forces a premature index_rescan call;
      instead, callers of index_beginscan must call index_rescan too.  Aside from
      making the AM-side initialization logic a bit less peculiar, this has the
      advantage that we do not make a useless extra am_rescan call when there are
      runtime key values.  AMs formerly could not assume that the key values
      passed to amrescan were actually valid; now they can.
      
      Teodor Sigaev and Tom Lane
      d583f10b
  18. 25 11月, 2010 1 次提交
    • T
      Create the system catalog infrastructure needed for KNNGIST. · 725d52d0
      Tom Lane 提交于
      This commit adds columns amoppurpose and amopsortfamily to pg_amop, and
      column amcanorderbyop to pg_am.  For the moment all the entries in
      amcanorderbyop are "false", since the underlying support isn't there yet.
      
      Also, extend the CREATE OPERATOR CLASS/ALTER OPERATOR FAMILY commands with
      [ FOR SEARCH | FOR ORDER BY sort_operator_family ] clauses to allow the new
      columns of pg_amop to be populated, and create pg_dump support for dumping
      that information.
      
      I also added some documentation, although it's perhaps a bit premature
      given that the feature doesn't do anything useful yet.
      
      Teodor Sigaev, Robert Haas, Tom Lane
      725d52d0
  19. 21 11月, 2010 1 次提交
  20. 19 11月, 2010 1 次提交
  21. 16 11月, 2010 1 次提交
    • R
      Add new buffers_backend_fsync field to pg_stat_bgwriter. · 3134d886
      Robert Haas 提交于
      This new field counts the number of times that a backend which writes a
      buffer out to the OS must also fsync() it.  This happens when the
      bgwriter fsync request queue is full, and is generally detrimental to
      performance, so it's good to know when it's happening.  Along the way,
      log a new message at level DEBUG1 whenever we fail to hand off an fsync,
      so that the problem can also be seen in examination of log files
      (if the logging level is cranked up high enough).
      
      Greg Smith, with minor tweaks by me.
      3134d886
  22. 10 11月, 2010 1 次提交
  23. 31 10月, 2010 1 次提交
    • T
      Provide hashing support for arrays. · 186cbbda
      Tom Lane 提交于
      The core of this patch is hash_array() and associated typcache
      infrastructure, which works just about exactly like the existing support
      for array comparison.
      
      In addition I did some work to ensure that the planner won't think that an
      array type is hashable unless its element type is hashable, and similarly
      for sorting.  This includes adding a datatype parameter to op_hashjoinable
      and op_mergejoinable, and adding an explicit "hashable" flag to
      SortGroupClause.  The lack of a cross-check on the element type was a
      pre-existing bug in mergejoin support --- but it didn't matter so much
      before, because if you couldn't sort the element type there wasn't any good
      alternative to failing anyhow.  Now that we have the alternative of hashing
      the array type, there are cases where we can avoid a failure by being picky
      at the planner stage, so it's time to be picky.
      
      The issue of exactly how to combine the per-element hash values to produce
      an array hash is still open for discussion, but the rest of this is pretty
      solid, so I'll commit it as-is.
      186cbbda
  24. 25 10月, 2010 1 次提交
  25. 22 10月, 2010 1 次提交
    • T
      Improve handling of domains over arrays. · 529cb267
      Tom Lane 提交于
      This patch eliminates various bizarre behaviors caused by sloppy thinking
      about the difference between a domain type and its underlying array type.
      In particular, the operation of updating one element of such an array
      has to be considered as yielding a value of the underlying array type,
      *not* a value of the domain, because there's no assurance that the
      domain's CHECK constraints are still satisfied.  If we're intending to
      store the result back into a domain column, we have to re-cast to the
      domain type so that constraints are re-checked.
      
      For similar reasons, such a domain can't be blindly matched to an ANYARRAY
      polymorphic parameter, because the polymorphic function is likely to apply
      array-ish operations that could invalidate the domain constraints.  For the
      moment, we just forbid such matching.  We might later wish to insert an
      automatic downcast to the underlying array type, but such a change should
      also change matching of domains to ANYELEMENT for consistency.
      
      To ensure that all such logic is rechecked, this patch removes the original
      hack of setting a domain's pg_type.typelem field to match its base type;
      the typelem will always be zero instead.  In those places where it's really
      okay to look through the domain type with no other logic changes, use the
      newly added get_base_element_type function in place of get_element_type.
      catversion bumped due to change in pg_type contents.
      
      Per bug #5717 from Richard Huxton and subsequent discussion.
      529cb267
  26. 16 10月, 2010 1 次提交
    • T
      Allow WITH clauses to be attached to INSERT, UPDATE, DELETE statements. · 07f1264d
      Tom Lane 提交于
      This is not the hoped-for facility of using INSERT/UPDATE/DELETE inside
      a WITH, but rather the other way around.  It seems useful in its own
      right anyway.
      
      Note: catversion bumped because, although the contents of stored rules
      might look compatible, there's actually a subtle semantic change.
      A single Query containing a WITH and INSERT...VALUES now represents
      writing the WITH before the INSERT, not before the VALUES.  While it's
      not clear that that matters to anyone, it seems like a good idea to
      have it cited in the git history for catversion.h.
      
      Original patch by Marko Tiikkaja, with updating and cleanup by
      Hitoshi Harada.
      07f1264d
  27. 11 10月, 2010 1 次提交
    • T
      Support triggers on views. · 2ec993a7
      Tom Lane 提交于
      This patch adds the SQL-standard concept of an INSTEAD OF trigger, which
      is fired instead of performing a physical insert/update/delete.  The
      trigger function is passed the entire old and/or new rows of the view,
      and must figure out what to do to the underlying tables to implement
      the update.  So this feature can be used to implement updatable views
      using trigger programming style rather than rule hacking.
      
      In passing, this patch corrects the names of some columns in the
      information_schema.triggers view.  It seems the SQL committee renamed
      them somewhere between SQL:99 and SQL:2003.
      
      Dean Rasheed, reviewed by Bernd Helmle; some additional hacking by me.
      2ec993a7
  28. 28 9月, 2010 2 次提交
  29. 21 9月, 2010 1 次提交
  30. 03 9月, 2010 1 次提交
    • T
      Install a data-type-based solution for protecting pg_get_expr(). · 303696c3
      Tom Lane 提交于
      Since the code underlying pg_get_expr() is not secure against malformed
      input, and can't practically be made so, we need to prevent miscreants
      from feeding arbitrary data to it.  We can do this securely by declaring
      pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
      system catalog columns that hold nodeToString output to be of that type.
      There is no way at SQL level to create a non-null value of type pg_node_tree.
      Since the backend-internal operations that fill those catalog columns
      operate below the SQL level, they are oblivious to the datatype relabeling
      and don't need any changes.
      303696c3
  31. 24 8月, 2010 1 次提交
  32. 21 8月, 2010 1 次提交
  33. 14 8月, 2010 1 次提交
  34. 11 8月, 2010 1 次提交
    • T
      Add three-parameter forms of array_to_string and string_to_array, to allow · 33f43725
      Tom Lane 提交于
      better handling of NULL elements within the arrays.  The third parameter
      is a string that should be used to represent a NULL element, or should
      be translated into a NULL element, respectively.  If the third parameter
      is NULL it behaves the same as the two-parameter form.
      
      There are two incompatible changes in the behavior of the two-parameter form
      of string_to_array.  First, it will return an empty (zero-element) array
      rather than NULL when the input string is of zero length.  Second, if the
      field separator is NULL, the function splits the string into individual
      characters, rather than returning NULL as before.  These two changes make
      this form fully compatible with the behavior of the new three-parameter form.
      
      Pavel Stehule, reviewed by Brendan Jurd
      33f43725