1. 19 8月, 2006 1 次提交
  2. 15 8月, 2006 1 次提交
    • T
      Fix oversight in initial implementation of PORTAL_ONE_RETURNING mode: we · 65b2f93b
      Tom Lane 提交于
      cannot assume that there's exactly one Query in the Portal, as we can for
      ONE_SELECT mode, because non-SELECT queries might have extra queries added
      during rule rewrites.  Fix things up so that we'll use ONE_RETURNING mode
      when a Portal contains one primary (canSetTag) query and that query has
      a RETURNING list.  This appears to be a second showstopper reason for running
      the Portal to completion before we start to hand anything back --- we want
      to be sure that the rule-added queries get run too.
      65b2f93b
  3. 13 8月, 2006 1 次提交
    • T
      Tweak SPI_cursor_open to allow INSERT/UPDATE/DELETE RETURNING; this was · 3f8db37c
      Tom Lane 提交于
      merely a matter of fixing the error check, since the underlying Portal
      infrastructure already handles it.  This in turn allows these statements
      to be used in some existing plpgsql and plperl contexts, such as a
      plpgsql FOR loop.  Also, do some marginal code cleanup in places that
      were being sloppy about distinguishing SELECT from SELECT INTO.
      3f8db37c
  4. 12 8月, 2006 1 次提交
  5. 08 8月, 2006 1 次提交
    • B
      For protocol-level prepare/bind/execute: · 3716f90c
      Bruce Momjian 提交于
      	o  print user name for all
      	o  print portal name if defined for all
      	o  print query for all
      	o  reduce log_statement header to single keyword
      	o  print bind parameters as DETAIL if text mode
      3716f90c
  6. 04 8月, 2006 2 次提交
  7. 02 8月, 2006 1 次提交
  8. 01 8月, 2006 1 次提交
    • T
      Change the relation_open protocol so that we obtain lock on a relation · 09d3670d
      Tom Lane 提交于
      (table or index) before trying to open its relcache entry.  This fixes
      race conditions in which someone else commits a change to the relation's
      catalog entries while we are in process of doing relcache load.  Problems
      of that ilk have been reported sporadically for years, but it was not
      really practical to fix until recently --- for instance, the recent
      addition of WAL-log support for in-place updates helped.
      
      Along the way, remove pg_am.amconcurrent: all AMs are now expected to support
      concurrent update.
      09d3670d
  9. 31 7月, 2006 1 次提交
    • T
      Change the bootstrap sequence so that toast tables for system catalogs are · 6e38e34d
      Tom Lane 提交于
      created in the bootstrap phase proper, rather than added after-the-fact
      by initdb.  This is cleaner than before because it allows us to retire the
      undocumented ALTER TABLE ... CREATE TOAST TABLE command, but the real reason
      I'm doing it is so that toast tables of shared catalogs will now have
      predetermined OIDs.  This will allow a reasonably clean solution to the
      problem of locking tables before we load their relcache entries, to appear
      in a forthcoming patch.
      6e38e34d
  10. 30 7月, 2006 1 次提交
  11. 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
  12. 19 7月, 2006 1 次提交
  13. 14 7月, 2006 2 次提交
  14. 12 7月, 2006 4 次提交
  15. 11 7月, 2006 2 次提交
    • T
      Fix ALTER TABLE to check pre-existing NOT NULL constraints when rewriting · cb33de77
      Tom Lane 提交于
      a table.  Otherwise a USING clause that yields NULL can leave the table
      violating its constraint (possibly there are other cases too).  Per report
      from Alexander Pravking.
      cb33de77
    • A
      Improve vacuum code to track minimum Xids per table instead of per database. · d4cef0aa
      Alvaro Herrera 提交于
      To this end, add a couple of columns to pg_class, relminxid and relvacuumxid,
      based on which we calculate the pg_database columns after each vacuum.
      
      We now force all databases to be vacuumed, even template ones.  A backend
      noticing too old a database (meaning pg_database.datminxid is in danger of
      falling behind Xid wraparound) will signal the postmaster, which in turn will
      start an autovacuum iteration to process the offending database.  In principle
      this is only there to cope with frozen (non-connectable) databases without
      forcing users to set them to connectable, but it could force regular user
      database to go through a database-wide vacuum at any time.  Maybe we should
      warn users about this somehow.  Of course the real solution will be to use
      autovacuum all the time ;-)
      
      There are some additional improvements we could have in this area: for example
      the vacuum code could be smarter about not updating pg_database for each table
      when called by autovacuum, and do it only once the whole autovacuum iteration
      is done.
      
      I updated the system catalogs documentation, but I didn't modify the
      maintenance section.  Also having some regression tests for this would be nice
      but it's not really a very straightforward thing to do.
      
      Catalog version bumped due to system catalog changes.
      d4cef0aa
  16. 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
  17. 02 7月, 2006 3 次提交
    • 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
  18. 28 6月, 2006 2 次提交
  19. 27 6月, 2006 3 次提交
  20. 22 6月, 2006 1 次提交
  21. 21 6月, 2006 2 次提交
    • T
      Remove redundant gettimeofday() calls to the extent practical without · 27c3e3de
      Tom Lane 提交于
      changing semantics too much.  statement_timestamp is now set immediately
      upon receipt of a client command message, and the various places that used
      to do their own gettimeofday() calls to mark command startup are referenced
      to that instead.  I have also made stats_command_string use that same
      value for pg_stat_activity.query_start for both the command itself and
      its eventual replacement by <IDLE> or <idle in transaction>.  There was
      some debate about that, but no argument that seemed convincing enough to
      justify an extra gettimeofday() call.
      27c3e3de
    • T
      Split definitions for md5.c out of crypt.h and into their own header · 47a37aee
      Tom Lane 提交于
      libpq/md5.h, so that there's a clear separation between backend-only
      definitions and shared frontend/backend definitions.  (Turns out this
      is reversing a bad decision from some years ago...)  Fix up references
      to crypt.h as needed.  I looked into moving the code into src/port, but
      the headers in src/include/libpq are sufficiently intertwined that it
      seems more work than it's worth to do that.
      47a37aee
  22. 17 6月, 2006 3 次提交
    • T
      44cb3ae7
    • A
      · bbcd0169
      Andrew Dunstan 提交于
      DROP ... IF EXISTS for the following cases:
        language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast.
      bbcd0169
    • T
      Fix problems with cached tuple descriptors disappearing while still in use · 06e10abc
      Tom Lane 提交于
      by creating a reference-count mechanism, similar to what we did a long time
      ago for catcache entries.  The back branches have an ugly solution involving
      lots of extra copies, but this way is more efficient.  Reference counting is
      only applied to tupdescs that are actually in caches --- there seems no need
      to use it for tupdescs that are generated in the executor, since they'll go
      away during plan shutdown by virtue of being in the per-query memory context.
      Neil Conway and Tom Lane
      06e10abc
  23. 08 6月, 2006 1 次提交
  24. 07 6月, 2006 1 次提交
  25. 30 5月, 2006 1 次提交
  26. 27 5月, 2006 1 次提交