1. 23 Jun, 2007 1 commit
    • Tom Lane's avatar
      Separate parse-analysis for utility commands out of parser/analyze.c · 46379d6e
      Tom Lane authored
      (which now deals only in optimizable statements), and put that code
      into a new file parser/parse_utilcmd.c.  This helps clarify and enforce
      the design rule that utility statements shouldn't be processed during
      the regular parse analysis phase; all interpretation of their meaning
      should happen after they are given to ProcessUtility to execute.
      (We need this because we don't retain any locks for a utility statement
      that's in a plan cache, nor have any way to detect that it's stale.)
      
      We are also able to simplify the API for parse_analyze() and related
      routines, because they will now always return exactly one Query structure.
      
      In passing, fix bug #3403 concerning trying to add a serial column to
      an existing temp table (this is largely Heikki's work, but we needed
      all that restructuring to make it safe).
      46379d6e
  2. 03 Jun, 2007 1 commit
    • Tom Lane's avatar
      Create a GUC parameter temp_tablespaces that allows selection of the · acfce502
      Tom Lane authored
      tablespace(s) in which to store temp tables and temporary files.  This is a
      list to allow spreading the load across multiple tablespaces (a random list
      element is chosen each time a temp object is to be created).  Temp files are
      not stored in per-database pgsql_tmp/ directories anymore, but per-tablespace
      directories.
      
      Jaime Casanova and Albert Cervera, with review by Bernd Helmle and Tom Lane.
      acfce502
  3. 02 May, 2007 1 commit
    • Tom Lane's avatar
      Fix things so that when CREATE INDEX CONCURRENTLY sets pg_index.indisvalid · 8ec94385
      Tom Lane authored
      true at the very end of its processing, the update is broadcast via a
      shared-cache-inval message for the index; without this, existing backends that
      already have relcache entries for the index might never see it become valid.
      Also, force a relcache inval on the index's parent table at the same time,
      so that any cached plans for that table are re-planned; this ensures that
      the newly valid index will be used if appropriate.  Aside from making
      C.I.C. behave more reasonably, this is necessary infrastructure for some
      aspects of the HOT patch.  Pavan Deolasee, with a little further stuff from
      me.
      8ec94385
  4. 13 Mar, 2007 1 commit
    • Tom Lane's avatar
      First phase of plan-invalidation project: create a plan cache management · b9527e98
      Tom Lane authored
      module and teach PREPARE and protocol-level prepared statements to use it.
      In service of this, rearrange utility-statement processing so that parse
      analysis does not assume table schemas can't change before execution for
      utility statements (necessary because we don't attempt to re-acquire locks
      for utility statements when reusing a stored plan).  This requires some
      refactoring of the ProcessUtility API, but it ends up cleaner anyway,
      for instance we can get rid of the QueryContext global.
      
      Still to do: fix up SPI and related code to use the plan cache; I'm tempted to
      try to make SQL functions use it too.  Also, there are at least some aspects
      of system state that we want to ensure remain the same during a replan as in
      the original processing; search_path certainly ought to behave that way for
      instance, and perhaps there are others.
      b9527e98
  5. 06 Mar, 2007 1 commit
  6. 01 Feb, 2007 1 commit
    • Bruce Momjian's avatar
      Wording cleanup for error messages. Also change can't -> cannot. · 8b4ff8b6
      Bruce Momjian authored
      Standard English uses "may", "can", and "might" in different ways:
      
              may - permission, "You may borrow my rake."
      
              can - ability, "I can lift that log."
      
              might - possibility, "It might rain today."
      
      Unfortunately, in conversational English, their use is often mixed, as
      in, "You may use this variable to do X", when in fact, "can" is a better
      choice.  Similarly, "It may crash" is better stated, "It might crash".
      8b4ff8b6
  7. 25 Jan, 2007 1 commit
  8. 20 Jan, 2007 1 commit
    • Tom Lane's avatar
      Simplify pg_am representation of ordering-capable access methods: · fcf4b146
      Tom Lane authored
      provide just a boolean 'amcanorder', instead of fields that specify the
      sort operator strategy numbers.  We have decided to require ordering-capable
      AMs to use btree-compatible strategy numbers, so the old fields are
      overkill (and indeed misleading about what's allowed).
      fcf4b146
  9. 09 Jan, 2007 1 commit
    • Tom Lane's avatar
      Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LAST · 44317582
      Tom Lane authored
      per-column options for btree indexes.  The planner's support for this is still
      pretty rudimentary; it does not yet know how to plan mergejoins with
      nondefault ordering options.  The documentation is pretty rudimentary, too.
      I'll work on improving that stuff later.
      
      Note incompatible change from prior behavior: ORDER BY ... USING will now be
      rejected if the operator is not a less-than or greater-than member of some
      btree opclass.  This prevents less-than-sane behavior if an operator that
      doesn't actually define a proper sort ordering is selected.
      44317582
  10. 05 Jan, 2007 1 commit
  11. 23 Dec, 2006 1 commit
    • Tom Lane's avatar
      Restructure operator classes to allow improved handling of cross-data-type · a78fcfb5
      Tom Lane authored
      cases.  Operator classes now exist within "operator families".  While most
      families are equivalent to a single class, related classes can be grouped
      into one family to represent the fact that they are semantically compatible.
      Cross-type operators are now naturally adjunct parts of a family, without
      having to wedge them into a particular opclass as we had done originally.
      
      This commit restructures the catalogs and cleans up enough of the fallout so
      that everything still works at least as well as before, but most of the work
      needed to actually improve the planner's behavior will come later.  Also,
      there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
      to create a new family right now is to allow CREATE OPERATOR CLASS to make
      one by default.  I owe some more documentation work, too.  But that can all
      be done in smaller pieces once this infrastructure is in place.
      a78fcfb5
  12. 04 Oct, 2006 1 commit
  13. 27 Aug, 2006 1 commit
    • Tom Lane's avatar
      Add a function GetLockConflicts() to lock.c to report xacts holding · e06fda0a
      Tom Lane authored
      locks that would conflict with a specified lock request, without
      actually trying to get that lock.  Use this instead of the former ad hoc
      method of doing the first wait step in CREATE INDEX CONCURRENTLY.
      Fixes problem with undetected deadlock and in many cases will allow the
      index creation to proceed sooner than it otherwise could've.  Per
      discussion with Greg Stark.
      e06fda0a
  14. 25 Aug, 2006 1 commit
  15. 31 Jul, 2006 1 commit
    • Tom Lane's avatar
      Change the bootstrap sequence so that toast tables for system catalogs are · 6e38e34d
      Tom Lane authored
      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
  16. 13 Jul, 2006 1 commit
  17. 11 Jul, 2006 1 commit
  18. 03 Jul, 2006 1 commit
    • Tom Lane's avatar
      Code review for FILLFACTOR patch. Change WITH grammar as per earlier · b7b78d24
      Tom Lane authored
      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
  19. 02 Jul, 2006 1 commit
  20. 07 Jun, 2006 2 commits
  21. 10 May, 2006 1 commit
    • Tom Lane's avatar
      Clean up code associated with updating pg_class statistics columns · 3fdeb189
      Tom Lane authored
      (relpages/reltuples).  To do this, create formal support in heapam.c for
      "overwrite" tuple updates (including xlog replay capability) and use that
      instead of the ad-hoc overwrites we'd been using in VACUUM and CREATE INDEX.
      Take the responsibility for updating stats during CREATE INDEX out of the
      individual index AMs, and do it where it belongs, in catalog/index.c.  Aside
      from being more modular, this avoids having to update the same tuple twice in
      some paths through CREATE INDEX.  It's probably not measurably faster, but
      for sure it's a lot cleaner than before.
      3fdeb189
  22. 05 Mar, 2006 1 commit
  23. 10 Feb, 2006 1 commit
  24. 22 Nov, 2005 1 commit
  25. 07 Nov, 2005 1 commit
  26. 15 Oct, 2005 1 commit
  27. 22 Jun, 2005 1 commit
  28. 21 Jun, 2005 1 commit
  29. 06 May, 2005 1 commit
  30. 14 Apr, 2005 2 commits
    • Tom Lane's avatar
      Completion of project to use fixed OIDs for all system catalogs and · 162bd08b
      Tom Lane authored
      indexes.  Replace all heap_openr and index_openr calls by heap_open
      and index_open.  Remove runtime lookups of catalog OID numbers in
      various places.  Remove relcache's support for looking up system
      catalogs by name.  Bulky but mostly very boring patch ...
      162bd08b
    • Tom Lane's avatar
      First phase of project to use fixed OIDs for all system catalogs and · 7c13781e
      Tom Lane authored
      indexes.  Extend the macros in include/catalog/*.h to carry the info
      about hand-assigned OIDs, and adjust the genbki script and bootstrap
      code to make the relations actually get those OIDs.  Remove the small
      number of RelOid_pg_foo macros that we had in favor of a complete
      set named like the catname.h and indexing.h macros.  Next phase will
      get rid of internal use of names for looking up catalogs and indexes;
      but this completes the changes forcing an initdb, so it looks like a
      good place to commit.
      Along the way, I made the shared relations (pg_database etc) not be
      'bootstrap' relations any more, so as to reduce the number of hardwired
      entries and simplify changing those relations in future.  I'm not
      sure whether they ever really needed to be handled as bootstrap
      relations, but it seems to work fine to not do so now.
      7c13781e
  31. 31 Dec, 2004 1 commit
    • PostgreSQL Daemon's avatar
      · 2ff50159
      PostgreSQL Daemon authored
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  32. 05 Nov, 2004 1 commit
    • Tom Lane's avatar
      Create 'default_tablespace' GUC variable that supplies a TABLESPACE · 98e8b480
      Tom Lane authored
      clause implicitly whenever one is not given explicitly.  Remove concept
      of a schema having an associated tablespace, and simplify the rules for
      selecting a default tablespace for a table or index.  It's now just
      (a) explicit TABLESPACE clause; (b) default_tablespace if that's not an
      empty string; (c) database's default.  This will allow pg_dump to use
      SET commands instead of tablespace clauses to determine object locations
      (but I didn't actually make it do so).  All per recent discussions.
      98e8b480
  33. 13 Sep, 2004 1 commit
    • Tom Lane's avatar
      Redesign query-snapshot timing so that volatile functions in READ COMMITTED · b2c40712
      Tom Lane authored
      mode see a fresh snapshot for each command in the function, rather than
      using the latest interactive command's snapshot.  Also, suppress fresh
      snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE
      functions, instead using the snapshot taken for the most closely nested
      regular query.  (This behavior is only sane for read-only functions, so
      the patch also enforces that such functions contain only SELECT commands.)
      As per my proposal of 6-Sep-2004; I note that I floated essentially the
      same proposal on 19-Jun-2002, but that discussion tailed off without any
      action.  Since 8.0 seems like the right place to be taking possibly
      nontrivial backwards compatibility hits, let's get it done now.
      b2c40712
  34. 29 Aug, 2004 2 commits
  35. 04 Aug, 2004 1 commit
  36. 18 Jun, 2004 1 commit
  37. 10 Jun, 2004 1 commit
    • Tom Lane's avatar
      Clean up generation of default names for constraints, indexes, and serial · 45616f5b
      Tom Lane authored
      sequences, as per recent discussion.  All these names are now of the
      form table_column_type, with digits added if needed to make them unique.
      Default constraint names are chosen to be unique across their whole schema,
      not just within the parent object, so as to be more SQL-spec-compatible
      and make the information schema views more useful.
      45616f5b