1. 18 11月, 2015 1 次提交
    • H
      Remove back-ported partial FDW support. · 601c58c3
      Heikki Linnakangas 提交于
      It was just syntax and catalogs, you couldn't actually do anything useful
      with it. Remove it, so that we have less code to maintain, until it's time
      to merge this stuff from upstream again when we merge with PostgreSQL 8.4.
      It's probably easier to merge this back at that point than maintain this
      backported version in the meanwhile. Less effort now, until we reach that
      point, and once we get to the point in 8.4 that we merge this in, we'll
      have all the preceding patches applied already, so it should merge quite
      smoothly.
      601c58c3
  2. 13 11月, 2015 2 次提交
    • H
      In readfast.c/outfast.c, reuse functions from readfuncs.c/outfuncs.c. · a64174dd
      Heikki Linnakangas 提交于
      Currently, readfast.c / outfast.c are mostly copy-pasted from readfuncs.c /
      outfuncs.c. That's a merge hazard: if a new field is added to a struct in
      upstream, and it's added to readfuncs.c and outfuncs.c, we would need to
      manually do the same in the readfast.c/outfast.c. If the patch applies
      cleanly, we will not notice, and we'll have a bug of omission.
      
      Refactor the code so that all those node types where the text and binary
      functions are identical, the duplicate in [read/out]fast.c is removed, and
      the definition [read/out]funcs.c is used to compile the binary version too.
      This involves some tricks with #ifdefs and #includes, but cuts a lot of
      duplicate code. This should avoid the merge hazard.
      
      We'll still need to maintain the read/out functions whenever we modify a
      struct in Greenplum, but that's no different from what needs to be done in
      PostgreSQL.
      a64174dd
    • H
      Refactor _read functions in readfast.c to be more like readfuncs.c · b0b3bf2d
      Heikki Linnakangas 提交于
      This reduces the diff between readfast.c and readfuncs.c. There are
      of course parts of these files that need to be different, but the bulk
      of the functions should be identical, with all the differences hidden
      in the READ_* macros. This patch reduces the diff and thus makes any
      suspicious differences between them more obvious.
      b0b3bf2d
  3. 12 11月, 2015 1 次提交
    • H
      Put back the out-function for PlannedStmt. · 35f25e89
      Heikki Linnakangas 提交于
      This partially reverts commit 4e01c159.
      The out-function for PlannedStmt is still needed, for debugging purposes,
      even though we never try to read them back in from text format. There is
      debug code in serializeNode that serializes a complete plan, and that
      gives a WARNING if there is no out-function for PlannedStmt. (I'm not
      convinced that code is doing much good, as it's only spewing stuff to the
      log under DEBUG5, and at that level it will just get lost in the noise.
      But that's a separate discussion). There is an out-function for
      PlannedStmt in PostgreSQL 9.3 too, which is where we it was backported
      from.
      
      While we're at it, take the opportunity to move _outPlannedStmt to the
      same location it's in in upstream, and remove spurious whitespace
      differences.
      35f25e89
  4. 11 11月, 2015 1 次提交
    • H
      Remove broken out/read support for PlannedStmts. · 4e01c159
      Heikki Linnakangas 提交于
      _readTupleDescNode function in readfuncs.c had an 'str' argument, but it
      was called with zero arguments. The reason that we haven't seen crashes
      is that the out/readfuncs.c support for PlannedStmts and TupleDescNodes is
      dead code. They are only serialized when sent from QD to QE, and we use
      the out/readfast.c functions for that.
      
      Remove the code, and add a few comments to TupleDescNode and PlannedStmt
      to clarify this a bit.
      4e01c159
  5. 28 10月, 2015 1 次提交
  6. 11 12月, 2006 1 次提交
    • T
      Add a paramtypmod field to Param nodes. This is dead weight for Params · 9fa12ddd
      Tom Lane 提交于
      representing externally-supplied values, since the APIs that carry such
      values only specify type not typmod.  However, for PARAM_SUBLINK Params
      it is handy to carry the typmod of the sublink's output column.  This
      is a much cleaner solution for the recently reported 'could not find
      pathkey item to sort' and 'failed to find unique expression in subplan
      tlist' bugs than my original 8.2-compatible patch.  Besides, someday we
      might want to support typmods for external parameters ...
      9fa12ddd
  7. 06 11月, 2006 1 次提交
    • T
      Fix recently-understood problems with handling of XID freezing, particularly · 48188e16
      Tom Lane 提交于
      in PITR scenarios.  We now WAL-log the replacement of old XIDs with
      FrozenTransactionId, so that such replacement is guaranteed to propagate to
      PITR slave databases.  Also, rather than relying on hint-bit updates to be
      preserved, pg_clog is not truncated until all instances of an XID are known to
      have been replaced by FrozenTransactionId.  Add new GUC variables and
      pg_autovacuum columns to allow management of the freezing policy, so that
      users can trade off the size of pg_clog against the amount of freezing work
      done.  Revise the already-existing code that forces autovacuum of tables
      approaching the wraparound point to make it more bulletproof; also, revise the
      autovacuum logic so that anti-wraparound vacuuming is done per-table rather
      than per-database.  initdb forced because of changes in pg_class, pg_database,
      and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
      48188e16
  8. 14 10月, 2006 1 次提交
  9. 04 10月, 2006 1 次提交
  10. 28 9月, 2006 1 次提交
  11. 20 9月, 2006 1 次提交
    • T
      Improve usage of effective_cache_size parameter by assuming that all the · b74c5436
      Tom Lane 提交于
      tables in the query compete for cache space, not just the one we are
      currently costing an indexscan for.  This seems more realistic, and it
      definitely will help in examples recently exhibited by Stefan
      Kaltenbrunner.  To get the total size of all the tables involved, we must
      tweak the handling of 'append relations' a bit --- formerly we looked up
      information about the child tables on-the-fly during set_append_rel_pathlist,
      but it needs to be done before we start doing any cost estimation, so
      push it into the add_base_rels_to_query scan.
      b74c5436
  12. 31 8月, 2006 1 次提交
  13. 25 8月, 2006 1 次提交
  14. 21 8月, 2006 1 次提交
    • T
      Fix all known problems with pg_dump's handling of serial sequences · 2b2a5072
      Tom Lane 提交于
      by abandoning the idea that it should say SERIAL in the dump.  Instead,
      dump serial sequences and column defaults just like regular ones.
      Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreate
      the sequence-to-column dependency that was formerly created "behind the
      scenes" by SERIAL.  This restores SERIAL to being truly "just a macro"
      consisting of component operations that can be stated explicitly in SQL.
      Furthermore, the new command allows sequence ownership to be reassigned,
      so that old mistakes can be cleaned up.
      
      Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since there
      is no longer any very compelling argument why the sequence couldn't be
      dropped while keeping the column.  (This forces initdb, to be sure the
      right kinds of dependencies are in there.)
      
      Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on an
      owned sequence; you can now only do this indirectly by changing the
      owning table's owner or schema.  This is an oversight in previous
      releases, but probably not worth back-patching.
      2b2a5072
  15. 12 8月, 2006 1 次提交
  16. 10 8月, 2006 1 次提交
  17. 02 8月, 2006 1 次提交
  18. 28 7月, 2006 1 次提交
    • T
      Aggregate functions now support multiple input arguments. I also took · 108fe473
      Tom Lane 提交于
      the opportunity to treat COUNT(*) as a zero-argument aggregate instead
      of the old hack that equated it to COUNT(1); this is materially cleaner
      (no more weird ANYOID cases) and ought to be at least a tiny bit faster.
      Original patch by Sergey Koposov; review, documentation, simple regression
      tests, pg_dump and psql support by moi.
      108fe473
  19. 14 7月, 2006 2 次提交
  20. 04 7月, 2006 1 次提交
    • T
      Code review for FILLFACTOR patch. Change WITH grammar as per earlier · b7b78d24
      Tom Lane 提交于
      discussion (including making def_arg allow reserved words), add missed
      opt_definition for UNIQUE case.  Put the reloptions support code in a less
      random place (I chose to make a new file access/common/reloptions.c).
      Eliminate header inclusion creep.  Make the index options functions safely
      user-callable (seems like client apps might like to be able to test validity
      of options before trying to make an index).  Reduce overhead for normal case
      with no options by allowing rd_options to be NULL.  Fix some unmaintainably
      klugy code, including getting rid of Natts_pg_class_fixed at long last.
      Some stylistic cleanup too, and pay attention to keeping comments in sync
      with code.
      
      Documentation still needs work, though I did fix the omissions in
      catalogs.sgml and indexam.sgml.
      b7b78d24
  21. 02 7月, 2006 4 次提交
    • N
      Do a pass of code review for the ALTER TABLE ADD INHERITS patch. Keep · 7fb9090e
      Neil Conway 提交于
      the read lock we hold on the table's parent relation until commit.
      Update equalfuncs.c for the new field in AlterTableCmd. Various
      improvements to comments, variable names, and error reporting.
      
      There is room for further improvement here, but this is at least
      a step in the right direction.
      7fb9090e
    • B
      Add FILLFACTOR to CREATE INDEX. · 277807bd
      Bruce Momjian 提交于
      ITAGAKI Takahiro
      277807bd
    • B
      ALTER TABLE ... ADD/DROPS INHERIT (actually INHERIT / NO INHERIT) · 8c092781
      Bruce Momjian 提交于
      Open items:
      
      There were a few tangentially related issues that have come up that I think
      are TODOs. I'm likely to tackle one or two of these next so I'm interested in
      hearing feedback on them as well.
      
      . Constraints currently do not know anything about inheritance. Tom suggested
        adding a coninhcount and conislocal like attributes have to track their
        inheritance status.
      
      . Foreign key constraints currently do not get copied to new children (and
        therefore my code doesn't verify them). I don't think it would be hard to
        add them and treat them like CHECK constraints.
      
      . No constraints at all are copied to tables defined with LIKE. That makes it
        hard to use LIKE to define new partitions. The standard defines LIKE and
        specifically says it does not copy constraints. But the standard already has
        an option called INCLUDING DEFAULTS; we could always define a non-standard
        extension LIKE table INCLUDING CONSTRAINTS that gives the user the option to
        request a copy including constraints.
      
      . Personally, I think the whole attislocal thing is bunk. The decision about
        whether to drop a column from children tables or not is something that
        should be up to the user and trying to DWIM based on whether there was ever
        a local definition or the column was acquired purely through inheritance is
        hardly ever going to match up with user expectations.
      
      . And of course there's the whole unique and primary key constraint issue. I
        think to get any traction at all on this you have a prerequisite of a real
        partitioned table implementation where the system knows what the partition
        key is so it can recognize when it's a leading part of an index key.
      
      Greg Stark
      8c092781
    • T
      Revise the planner's handling of "pseudoconstant" WHERE clauses, that is · cffd89ca
      Tom Lane 提交于
      clauses containing no variables and no volatile functions.  Such a clause
      can be used as a one-time qual in a gating Result plan node, to suppress
      plan execution entirely when it is false.  Even when the clause is true,
      putting it in a gating node wins by avoiding repeated evaluation of the
      clause.  In previous PG releases, query_planner() would do this for
      pseudoconstant clauses appearing at the top level of the jointree, but
      there was no ability to generate a gating Result deeper in the plan tree.
      To fix it, get rid of the special case in query_planner(), and instead
      process pseudoconstant clauses through the normal RestrictInfo qual
      distribution mechanism.  When a pseudoconstant clause is found attached to
      a path node in create_plan(), pull it out and generate a gating Result at
      that point.  This requires special-casing pseudoconstants in selectivity
      estimation and cost_qual_eval, but on the whole it's pretty clean.
      It probably even makes the planner a bit faster than before for the normal
      case of no pseudoconstants, since removing pull_constant_clauses saves one
      useless traversal of the qual tree.  Per gripe from Phil Frost.
      cffd89ca
  22. 27 6月, 2006 1 次提交
  23. 17 6月, 2006 1 次提交
    • A
      · bbcd0169
      Andrew Dunstan 提交于
      DROP ... IF EXISTS for the following cases:
        language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast.
      bbcd0169
  24. 01 5月, 2006 1 次提交
  25. 22 4月, 2006 1 次提交
  26. 16 4月, 2006 1 次提交
    • T
      Support the syntax · 3651a3e6
      Tom Lane 提交于
      	CREATE AGGREGATE aggname (input_type) (parameter_list)
      along with the old syntax where the input type was named in the parameter
      list.  This fits more naturally with the way that the aggregate is identified
      in DROP AGGREGATE and other utility commands; furthermore it has a natural
      extension to handle multiple-input aggregates, where the basetype-parameter
      method would get ugly.  In fact, this commit fixes the grammar and all the
      utility commands to support multiple-input aggregates; but DefineAggregate
      rejects it because the executor isn't fixed yet.
      I didn't do anything about treating agg(*) as a zero-input aggregate instead
      of artificially making it a one-input aggregate, but that should be considered
      in combination with supporting multi-input aggregates.
      3651a3e6
  27. 05 4月, 2006 1 次提交
    • T
      Modify all callers of datatype input and receive functions so that if these · 147d4bf3
      Tom Lane 提交于
      functions are not strict, they will be called (passing a NULL first parameter)
      during any attempt to input a NULL value of their datatype.  Currently, all
      our input functions are strict and so this commit does not change any
      behavior.  However, this will make it possible to build domain input functions
      that centralize checking of domain constraints, thereby closing numerous holes
      in our domain support, as per previous discussion.
      
      While at it, I took the opportunity to introduce convenience functions
      InputFunctionCall, OutputFunctionCall, etc to use in code that calls I/O
      functions.  This eliminates a lot of grotty-looking casts, but the main
      motivation is to make it easier to grep for these places if we ever need
      to touch them again.
      147d4bf3
  28. 23 3月, 2006 1 次提交
  29. 16 3月, 2006 1 次提交
    • T
      Clean up representation of function RTEs for functions returning RECORD. · 23160139
      Tom Lane 提交于
      The original coding stored the raw parser output (ColumnDef and TypeName
      nodes) which was ugly, bulky, and wrong because it failed to create any
      dependency on the referenced datatype --- and in fact would not track type
      renamings and suchlike.  Instead store a list of column type OIDs in the
      RTE.
      
      Also fix up general failure of recordDependencyOnExpr to do anything sane
      about recording dependencies on datatypes.  While there are many cases where
      there will be an indirect dependency (eg if an operator returns a datatype,
      the dependency on the operator is enough), we do have to record the datatype
      as a separate dependency in examples like CoerceToDomain.
      
      initdb forced because of change of stored rules.
      23160139
  30. 15 3月, 2006 1 次提交
    • T
      Improve parser so that we can show an error cursor position for errors · 20ab467d
      Tom Lane 提交于
      during parse analysis, not only errors detected in the flex/bison stages.
      This is per my earlier proposal.  This commit includes all the basic
      infrastructure, but locations are only tracked and reported for errors
      involving column references, function calls, and operators.  More could
      be done later but this seems like a good set to start with.  I've also
      moved the ReportSyntaxErrorPosition logic out of psql and into libpq,
      which should make it available to more people --- even within psql this
      is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
      20ab467d
  31. 05 3月, 2006 1 次提交
  32. 03 3月, 2006 1 次提交
  33. 19 2月, 2006 1 次提交
  34. 05 2月, 2006 1 次提交
    • A
      · f8b54fe6
      Andrew Dunstan 提交于
      DROP IF EXISTS for ROLE/USER/GROUP
      f8b54fe6
  35. 01 2月, 2006 1 次提交
    • T
      Restructure planner's handling of inheritance. Rather than processing · 8a1468af
      Tom Lane 提交于
      inheritance trees on-the-fly, which pretty well constrained us to considering
      only one way of planning inheritance, expand inheritance sets during the
      planner prep phase, and build a side data structure that can be consulted
      later to find which RTEs are members of which inheritance sets.  As proof of
      concept, use the data structure to plan joins against inheritance sets more
      efficiently: we can now use indexes on the set members in inner-indexscan
      joins.  (The generated plans could be improved further, but it'll take some
      executor changes.)  This data structure will also support handling UNION ALL
      subqueries in the same way as inheritance sets, but that aspect of it isn't
      finished yet.
      8a1468af