1. 13 Oct, 2011 6 commits
    • Tom Lane's avatar
      Fix up Perl-to-Postgres datatype conversions in pl/perl. · 23610daf
      Tom Lane authored
      This patch restores the pre-9.1 behavior that pl/perl functions returning
      VOID ignore the result value of their last Perl statement.  9.1.0
      unintentionally threw an error if the last statement returned a reference,
      as reported by Amit Khandekar.
      
      Also, make sure it works to return a string value for a composite type,
      so long as the string meets the type's input format.  We already allowed
      the equivalent behavior for arrays, so it seems inconsistent to not allow
      it for composites.
      
      In addition, ensure we throw errors for attempts to return arrays or hashes
      when the function's declared result type is not an array or composite type,
      respectively.  Pre-9.1 versions rather uselessly returned strings like
      ARRAY(0x221a9a0) or HASH(0x221aa90), while 9.1.0 threw an error for the
      hash case and returned a garbage value for the array case.
      
      Also, clean up assorted grotty coding in Perl array conversion, including
      use of a session-lifespan memory context to accumulate the array value
      (resulting in session-lifespan memory leak on error), failure to apply the
      declared typmod if any, and failure to detect some cases of non-rectangular
      multi-dimensional arrays.
      
      Alex Hunsaker and Tom Lane
      23610daf
    • Bruce Momjian's avatar
      Update documentation about ts_rank(). · fb4340c5
      Bruce Momjian authored
      fb4340c5
    • Bruce Momjian's avatar
      Have pg_ctl return an exit status of 3 if the server is not running, to · 12ff9fa7
      Bruce Momjian authored
      match the Linux Standard Base Core Specification 3.1.
      
      Aaron W. Swenson
      12ff9fa7
    • Tom Lane's avatar
      Fix typo in dummy_seclabel documentation. · de1bf53a
      Tom Lane authored
      dummy_label -> dummy_seclabel
      
      Thom Brown
      de1bf53a
    • Bruce Momjian's avatar
    • Bruce Momjian's avatar
      Remove tab in sgml file. · 4c32f817
      Bruce Momjian authored
      4c32f817
  2. 12 Oct, 2011 9 commits
  3. 11 Oct, 2011 8 commits
    • Tom Lane's avatar
      Add comment on why pulling data from a "name" index column can't crash. · 8c8ba6d1
      Tom Lane authored
      It's been bothering me for several days that pretending that the cstring
      data stored in a btree name_ops column is really a "name" Datum could lead
      to reading past the end of memory.  However, given the current memory
      layout used for index-only scans in the btree code, a crash is in fact not
      possible.  Document that so we don't break it.  I have not thought of any
      other solutions that aren't fairly ugly too, and most of them lose the
      functionality of index-only scans on name columns altogether, so this seems
      like the way to go.
      8c8ba6d1
    • Tom Lane's avatar
      Generate index-only scan tuple descriptor from the plan node's indextlist. · cb6771fb
      Tom Lane authored
      Dept. of second thoughts: as long as we've got that tlist hanging around
      anyway, we can apply ExecTypeFromTL to it to get a suitable descriptor for
      the ScanTupleSlot.  This is a nicer solution than the previous one because
      it eliminates some hard-wired knowledge about btree name_ops, and because
      it avoids the somewhat shaky assumption that we needn't set up the scan
      tuple descriptor in EXPLAIN_ONLY mode.  It doesn't change what actually
      happens at run-time though, and I'm still a bit nervous about that.
      cb6771fb
    • Bruce Momjian's avatar
      Improve entab's Makefile install entry. · e991930e
      Bruce Momjian authored
      Andrew Dunstan
      e991930e
    • Bruce Momjian's avatar
      Document that not backing up postmaster.pid and postmaster.opts might · 47cacfc0
      Bruce Momjian authored
      help prevent pg_ctl from getting confused.
      
      Backpatch to 9.1.
      47cacfc0
    • Tom Lane's avatar
      Consider index-only scans even when there is no matching qual or ORDER BY. · 600d3206
      Tom Lane authored
      By popular demand.
      600d3206
    • Tom Lane's avatar
      Rearrange the implementation of index-only scans. · a0185461
      Tom Lane authored
      This commit changes index-only scans so that data is read directly from the
      index tuple without first generating a faux heap tuple.  The only immediate
      benefit is that indexes on system columns (such as OID) can be used in
      index-only scans, but this is necessary infrastructure if we are ever to
      support index-only scans on expression indexes.  The executor is now ready
      for that, though the planner still needs substantial work to recognize
      the possibility.
      
      To do this, Vars in index-only plan nodes have to refer to index columns
      not heap columns.  I introduced a new special varno, INDEX_VAR, to mark
      such Vars to avoid confusion.  (In passing, this commit renames the two
      existing special varnos to OUTER_VAR and INNER_VAR.)  This allows
      ruleutils.c to handle them with logic similar to what we use for subplan
      reference Vars.
      
      Since index-only scans are now fundamentally different from regular
      indexscans so far as their expression subtrees are concerned, I also chose
      to change them to have their own plan node type (and hence, their own
      executor source file).
      a0185461
    • Robert Haas's avatar
      Replace hardcoded switch in object_exists() with a lookup table. · fa351d5a
      Robert Haas authored
      There's no particular advantage to this change on its face; indeed,
      it's possible that this might be slightly slower than the old way.
      But it makes this information more easily accessible to other
      functions, and therefore paves the way for future code consolidation.
      Performance isn't critical here, so there's no need to be smart about
      how we do the search.
      
      This is a heavily cut-down version of a patch from KaiGai Kohei,
      with several fixes by me.  Additional review from Dimitri Fontaine.
      fa351d5a
    • Robert Haas's avatar
      Repair breakage in VirtualXactLock. · e76bcaba
      Robert Haas authored
      I broke this in commit 84e37126.  Report and
      fix by Fujii Masao.
      e76bcaba
  4. 10 Oct, 2011 11 commits
  5. 09 Oct, 2011 3 commits
    • Heikki Linnakangas's avatar
      Clean up a couple of box gist helper functions. · d50e1251
      Heikki Linnakangas authored
      The original idea of this patch was to make box picksplit run faster, by
      eliminating unnecessary palloc() overhead, but that was obsoleted by the new
      double-sorting split algorithm that doesn't call these functions so heavily
      anymore. Nevertheless, the code looks better this way.
      
      Original patch by me, reviewed and tidied up after the double-sorting patch
      by Kevin Grittner.
      d50e1251
    • Tom Lane's avatar
      Improve index-only scans to avoid repeated access to the index page. · cbfa92c2
      Tom Lane authored
      We copy all the matched tuples off the page during _bt_readpage, instead of
      expensively re-locking the page during each subsequent tuple fetch.  This
      costs a bit more local storage, but not more than 2*BLCKSZ worth, and the
      reduction in LWLock traffic is certainly worth that.  What's more, this
      lets us get rid of the API wart in the original patch that said an index AM
      could randomly decline to supply an index tuple despite having asserted
      pg_am.amcanreturn.  That will be important for future improvements in the
      index-only-scan feature, since the executor will now be able to rely on
      having the index data available.
      cbfa92c2
    • Tom Lane's avatar
      Prevent index-only scans in stats regression test. · 45401c1c
      Tom Lane authored
      This bollixes the test because it's expecting to see the idx_tup_fetch
      counter increase, which won't happen if heap fetches were avoided by use
      of an index-only scan.  Per buildfarm results.
      
      While at it, let's just make sure that enable_seqscan and enable_indexscan
      are ON for this test ...
      45401c1c
  6. 08 Oct, 2011 3 commits