1. 08 8月, 2005 1 次提交
    • T
      Cause ShutdownPostgres to do a normal transaction abort during backend · 7117cd3a
      Tom Lane 提交于
      exit, instead of trying to take shortcuts.  Introduce some additional
      shutdown callback routines to eliminate kluges like having ProcKill
      be responsible for shutting down the buffer manager.  Ensure that the
      order of operations during shutdown is predictable and what you would
      expect given the module layering.
      7117cd3a
  2. 21 7月, 2005 1 次提交
  3. 14 7月, 2005 1 次提交
  4. 11 7月, 2005 1 次提交
    • T
      Change typreceive function API so that receive functions get the same · d78397d3
      Tom Lane 提交于
      optional arguments as text input functions, ie, typioparam OID and
      atttypmod.  Make all the datatypes that use typmod enforce it the same
      way in typreceive as they do in typinput.  This fixes a problem with
      failure to enforce length restrictions during COPY FROM BINARY.
      d78397d3
  5. 04 7月, 2005 1 次提交
    • T
      Arrange for the postmaster (and standalone backends, initdb, etc) to · eb5949d1
      Tom Lane 提交于
      chdir into PGDATA and subsequently use relative paths instead of absolute
      paths to access all files under PGDATA.  This seems to give a small
      performance improvement, and it should make the system more robust
      against naive DBAs doing things like moving a database directory that
      has a live postmaster in it.  Per recent discussion.
      eb5949d1
  6. 30 6月, 2005 1 次提交
    • T
      Clean up the rather historically encumbered interface to now() and · b5f7cff8
      Tom Lane 提交于
      current time: provide a GetCurrentTimestamp() function that returns
      current time in the form of a TimestampTz, instead of separate time_t
      and microseconds fields.  This is what all the callers really want
      anyway, and it eliminates low-level dependencies on AbsoluteTime,
      which is a deprecated datatype that will have to disappear eventually.
      b5f7cff8
  7. 23 6月, 2005 1 次提交
  8. 18 6月, 2005 1 次提交
  9. 15 6月, 2005 1 次提交
  10. 04 6月, 2005 1 次提交
    • T
      Revise handling of dropped columns in JOIN alias lists to avoid a · ba420024
      Tom Lane 提交于
      performance problem pointed out by phil@vodafone: to wit, we were
      spending O(N^2) time to check dropped-ness in an N-deep join tree,
      even in the case where the tree was freshly constructed and couldn't
      possibly mention any dropped columns.  Instead of recursing in
      get_rte_attribute_is_dropped(), change the data structure definition:
      the joinaliasvars list of a JOIN RTE must have a NULL Const instead
      of a Var at any position that references a now-dropped column.  This
      costs nothing during normal parse-rewrite-plan path, and instead we
      have a linear-time update to make when loading a stored rule that
      might contain now-dropped columns.  While at it, move the responsibility
      for acquring locks on relations referenced by rules into this separate
      function (which I therefore chose to call AcquireRewriteLocks).
      This saves effort --- namely, duplicated lock grabs in parser and rewriter
      --- in the normal path at a cost of one extra non-locked heap_open()
      in the stored-rule path; seems a good tradeoff.  A fringe benefit is
      that it is now *much* clearer that we acquire lock on relations referenced
      in rules before we make any rewriter decisions based on their properties.
      (I don't know of any bug of that ilk, but it wasn't exactly clear before.)
      ba420024
  11. 03 6月, 2005 1 次提交
    • T
      Push enable/disable of notify and catchup interrupts all the way down · b5ebef7c
      Tom Lane 提交于
      to just around the bare recv() call that gets a command from the client.
      The former placement in PostgresMain was unsafe because the intermediate
      processing layers (especially SSL) use facilities such as malloc that are
      not necessarily re-entrant.  Per report from counterstorm.com.
      b5ebef7c
  12. 02 6月, 2005 1 次提交
  13. 24 5月, 2005 1 次提交
  14. 22 4月, 2005 1 次提交
  15. 22 2月, 2005 1 次提交
  16. 20 2月, 2005 1 次提交
    • T
      Add code to prevent transaction ID wraparound by enforcing a safe limit · 60b2444c
      Tom Lane 提交于
      in GetNewTransactionId().  Since the limit value has to be computed
      before we run any real transactions, this requires adding code to database
      startup to scan pg_database and determine the oldest datfrozenxid.
      This can conveniently be combined with the first stage of an attack on
      the problem that the 'flat file' copies of pg_shadow and pg_group are
      not properly updated during WAL recovery.  The code I've added to
      startup resides in a new file src/backend/utils/init/flatfiles.c, and
      it is responsible for rewriting the flat files as well as initializing
      the XID wraparound limit value.  This will eventually allow us to get
      rid of GetRawDatabaseInfo too, but we'll need an initdb so we can add
      a trigger to pg_database.
      60b2444c
  17. 01 1月, 2005 1 次提交
    • P
      · 2ff50159
      PostgreSQL Daemon 提交于
      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
  18. 25 11月, 2004 1 次提交
    • T
      A client_encoding specification coming from the connection request has · cf796cc7
      Tom Lane 提交于
      to be processed by GUC before InitPostgres, because any required lookup
      of the encoding conversion function has to be done during InitializeClientEncoding.
      So, I broke this last week by moving GUC processing to after InitPostgres :-(.
      What we can do as a compromise is process non-SUSET variables during
      command line scanning (the same as before), and postpone the processing
      of only SUSET variables.  None of the SUSET variables need to be set
      before InitPostgres.
      cf796cc7
  19. 20 11月, 2004 1 次提交
  20. 15 11月, 2004 1 次提交
  21. 16 10月, 2004 1 次提交
  22. 13 10月, 2004 1 次提交
  23. 08 10月, 2004 1 次提交
  24. 26 9月, 2004 1 次提交
  25. 14 9月, 2004 1 次提交
    • T
      Redesign query-snapshot timing so that volatile functions in READ COMMITTED · b2c40712
      Tom Lane 提交于
      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
  26. 11 9月, 2004 1 次提交
    • T
      Fire non-deferred AFTER triggers immediately upon query completion, · b339d1ff
      Tom Lane 提交于
      rather than when returning to the idle loop.  This makes no particular
      difference for interactively-issued queries, but it makes a big difference
      for queries issued within functions: trigger execution now occurs before
      the calling function is allowed to proceed.  This responds to numerous
      complaints about nonintuitive behavior of foreign key checking, such as
      http://archives.postgresql.org/pgsql-bugs/2004-09/msg00020.php, and
      appears to be required by the SQL99 spec.
      Also take the opportunity to simplify the data structures used for the
      pending-trigger list, rename them for more clarity, and squeeze out a
      bit of space.
      b339d1ff
  27. 29 8月, 2004 2 次提交
  28. 02 8月, 2004 1 次提交
    • T
      Allow DECLARE CURSOR to take parameters from the portal in which it is · f622c540
      Tom Lane 提交于
      executed.  Previously, the DECLARE would succeed but subsequent FETCHes
      would fail since the parameter values supplied to DECLARE were not
      propagated to the portal created for the cursor.
      In support of this, add type Oids to ParamListInfo entries, which seems
      like a good idea anyway since code that extracts a value can double-check
      that it got the type of value it was expecting.
      Oliver Jowett, with minor editorialization by Tom Lane.
      f622c540
  29. 31 7月, 2004 1 次提交
  30. 29 7月, 2004 1 次提交
  31. 27 7月, 2004 1 次提交
  32. 17 7月, 2004 1 次提交
    • T
      Invent ResourceOwner mechanism as per my recent proposal, and use it to · fe548629
      Tom Lane 提交于
      keep track of portal-related resources separately from transaction-related
      resources.  This allows cursors to work in a somewhat sane fashion with
      nested transactions.  For now, cursor behavior is non-subtransactional,
      that is a cursor's state does not roll back if you abort a subtransaction
      that fetched from the cursor.  We might want to change that later.
      fe548629
  33. 11 7月, 2004 1 次提交
  34. 01 7月, 2004 1 次提交
  35. 25 6月, 2004 1 次提交
  36. 11 6月, 2004 1 次提交
    • T
      When using extended-query protocol, postpone planning of unnamed statements · 7643bed5
      Tom Lane 提交于
      until Bind is received, so that actual parameter values are visible to the
      planner.  Make use of the parameter values for estimation purposes (but
      don't fold them into the actual plan).  This buys back most of the
      potential loss of plan quality that ensues from using out-of-line
      parameters instead of putting literal values right into the query text.
      
      This patch creates a notion of constant-folding expressions 'for
      estimation purposes only', in which case we can be more aggressive than
      the normal eval_const_expressions() logic can be.  Right now the only
      difference in behavior is inserting bound values for Params, but it will
      be interesting to look at other possibilities.  One that we've seen
      come up repeatedly is reducing now() and related functions to current
      values, so that queries like ... WHERE timestampcol > now() - '1 day'
      have some chance of being planned effectively.
      
      Oliver Jowett, with some kibitzing from Tom Lane.
      7643bed5
  37. 06 6月, 2004 1 次提交
    • T
      Infrastructure for I/O of composite types: arrange for the I/O routines · c541bb86
      Tom Lane 提交于
      of a composite type to get that type's OID as their second parameter,
      in place of typelem which is useless.  The actual changes are mostly
      centralized in getTypeInputInfo and siblings, but I had to fix a few
      places that were fetching pg_type.typelem for themselves instead of
      using the lsyscache.c routines.  Also, I renamed all the related variables
      from 'typelem' to 'typioparam' to discourage people from assuming that
      they necessarily contain array element types.
      c541bb86
  38. 03 6月, 2004 1 次提交
    • T
      Adjust our timezone library to use pg_time_t (typedef'd as int64) in · 921d749b
      Tom Lane 提交于
      place of time_t, as per prior discussion.  The behavior does not change
      on machines without a 64-bit-int type, but on machines with one, which
      is most, we are rid of the bizarre boundary behavior at the edges of
      the 32-bit-time_t range (1901 and 2038).  The system will now treat
      times over the full supported timestamp range as being in your local
      time zone.  It may seem a little bizarre to consider that times in
      4000 BC are PST or EST, but this is surely at least as reasonable as
      propagating Gregorian calendar rules back that far.
      
      I did not modify the format of the zic timezone database files, which
      means that for the moment the system will not know about daylight-savings
      periods outside the range 1901-2038.  Given the way the files are set up,
      it's not a simple decision like 'widen to 64 bits'; we have to actually
      think about the range of years that need to be supported.  We should
      probably inquire what the plans of the upstream zic people are before
      making any decisions of our own.
      921d749b
  39. 30 5月, 2004 1 次提交
    • T
      Separate out bgwriter code into a logically separate module, rather · 076a055a
      Tom Lane 提交于
      than being random pieces of other files.  Give bgwriter responsibility
      for all checkpoint activity (other than a post-recovery checkpoint);
      so this child process absorbs the functionality of the former transient
      checkpoint and shutdown subprocesses.  While at it, create an actual
      include file for postmaster.c, which for some reason never had its own
      file before.
      076a055a