1. 19 10月, 2011 5 次提交
    • T
      Suppress -Wunused-result warnings about write() and fwrite(). · aa90e148
      Tom Lane 提交于
      This is merely an exercise in satisfying pedants, not a bug fix, because
      in every case we were checking for failure later with ferror(), or else
      there was nothing useful to be done about a failure anyway.  Document
      the latter cases.
      aa90e148
    • R
      Make the CHECKPOINT reference page more clear. · c53d3a9e
      Robert Haas 提交于
      Josh Kupershmidt, reviewed by Fujii Masao
      c53d3a9e
    • T
      Reject empty pg_hba.conf files. · e27f52f3
      Tom Lane 提交于
      An empty HBA file is surely an error, since it means there is no way to
      connect to the server.  We've not heard identifiable reports of people
      actually doing that, but this will also close off the case Thom Brown just
      complained of, namely pointing hba_file at a directory.  (On at least some
      platforms with some directories, it will read as an empty file.)
      
      Perhaps this should be back-patched, but given the lack of previous
      complaints, I won't add extra work for the translators.
      e27f52f3
    • T
      Remove unnecessary AssertMacro() to suppress gcc 4.6 compiler warning. · 7c19e044
      Tom Lane 提交于
      There's no particular value in doing AssertMacro((tup) != NULL) in front
      of code that's certain to crash anyway if tup is NULL.  And if "tup" is
      actually the address of a local variable, gcc 4.6 whinges about it.  That's
      arguably pretty broken on gcc's part, but we might as well remove the
      useless test to silence the warnings.  This gets rid of all the -Waddress
      warnings in the backend; there are some in libpq and psql that are a bit
      harder to avoid.
      7c19e044
    • T
      Fix pg_dump to dump casts between auto-generated types. · b246207b
      Tom Lane 提交于
      The heuristic for when to dump a cast failed for a cast between table
      rowtypes, as reported by Frédéric Rejol.  Fix it by setting
      the "dump" flag for such a type the same way as the flag is set for the
      underlying table or base type.  This won't result in the auto-generated
      type appearing in the output, since setting its objType to DO_DUMMY_TYPE
      unconditionally suppresses that.  But it will result in dumpCast doing what
      was intended.
      
      Back-patch to 8.3.  The 8.2 code is rather different in this area, and it
      doesn't seem worth any risk to fix a corner case that nobody has stumbled
      on before.
      b246207b
  2. 18 10月, 2011 1 次提交
  3. 17 10月, 2011 3 次提交
    • T
      Avoid assuming that index-only scan data matches the index's rowtype. · 336c1d7a
      Tom Lane 提交于
      In general the data returned by an index-only scan should have the
      datatypes originally computed by FormIndexDatum.  If the index opclasses
      use "storage" datatypes different from their input datatypes, the scan
      tuple will not have the same rowtype attributed to the index; but we had
      a hard-wired assumption that that was true in nodeIndexonlyscan.c.  We'd
      already hacked around the issue for the one case where the types are
      different in btree indexes (btree name_ops), but this would definitely
      come back to bite us if we ever implement index-only scans in GiST.
      
      To fix, require the index AM to explicitly provide the tupdesc for the
      tuple it is returning.  btree can just pass back the index's tupdesc, but
      GiST will have to work harder when and if it supports index-only scans.
      
      I had previously proposed fixing this by allowing the index AM to fill the
      scan tuple slot directly; but on reflection that seemed like a module
      layering violation, since TupleTableSlots are creatures of the executor.
      At least in the btree case, it would also be less efficient, since the
      tuple deconstruction work would occur even for rows later found to be
      invisible to the scan's snapshot.
      336c1d7a
    • T
      Fix collate.linux.utf8 expected output for recent error message change. · e661c3df
      Tom Lane 提交于
      Noted by Jeff Davis.
      e661c3df
    • T
      Teach btree to handle ScalarArrayOpExpr quals natively. · 9e8da0f7
      Tom Lane 提交于
      This allows "indexedcol op ANY(ARRAY[...])" conditions to be used in plain
      indexscans, and particularly in index-only scans.
      9e8da0f7
  4. 16 10月, 2011 1 次提交
  5. 15 10月, 2011 6 次提交
    • B
      Document that is the psql version number, not the server version number, · b4aec388
      Bruce Momjian 提交于
      that controls .psqlrc.
      b4aec388
    • B
      Improve doc wording of drop table permission. · 2deba6d4
      Bruce Momjian 提交于
      2deba6d4
    • B
      Allow a major PG version psql .psqlrc file to be used if a minor · 2795592e
      Bruce Momjian 提交于
      matching version file does not exist.  This avoids needing to rename
      .psqlrc files after minor version upgrades.
      2795592e
    • T
      Fix bugs in information_schema.referential_constraints view. · d26e1eba
      Tom Lane 提交于
      This view was being insufficiently careful about matching the FK constraint
      to the depended-on primary or unique key constraint.  That could result in
      failure to show an FK constraint at all, or showing it multiple times, or
      claiming that it depended on a different constraint than the one it really
      does.  Fix by joining via pg_depend to ensure that we find only the correct
      dependency.
      
      Back-patch, but don't bump catversion because we can't force initdb in back
      branches.  The next minor-version release notes should explain that if you
      need to fix this in an existing installation, you can drop the
      information_schema schema then re-create it by sourcing
      $SHAREDIR/information_schema.sql in each database (as a superuser of
      course).
      d26e1eba
    • T
      Measure the number of all-visible pages for use in index-only scan costing. · e6858e66
      Tom Lane 提交于
      Add a column pg_class.relallvisible to remember the number of pages that
      were all-visible according to the visibility map as of the last VACUUM
      (or ANALYZE, or some other operations that update pg_class.relpages).
      Use relallvisible/relpages, instead of an arbitrary constant, to estimate
      how many heap page fetches can be avoided during an index-only scan.
      
      This is pretty primitive and will no doubt see refinements once we've
      acquired more field experience with the index-only scan mechanism, but
      it's way better than using a constant.
      
      Note: I had to adjust an underspecified query in the window.sql regression
      test, because it was changing answers when the plan changed to use an
      index-only scan.  Some of the adjacent tests perhaps should be adjusted
      as well, but I didn't do that here.
      e6858e66
    • R
      Dump all roles first, then all config settings on roles. · dea95c7a
      Robert Haas 提交于
      This way, if a role's config setting uses the name of another role,
      the validity of the dump isn't dependent on the order in which those
      two roles are dumped.
      
      Code by Phil Sorber, comment by me.
      dea95c7a
  6. 14 10月, 2011 7 次提交
  7. 13 10月, 2011 10 次提交
  8. 12 10月, 2011 7 次提交
    • B
      Add Up/Home link to the top of the HTML doc output. · b8691d83
      Bruce Momjian 提交于
      Backpatch to 9.0.X and 9.1.X.
      b8691d83
    • T
      Add comment on why pulling data from a "name" index column can't crash. · 8c8ba6d1
      Tom Lane 提交于
      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
    • T
      Generate index-only scan tuple descriptor from the plan node's indextlist. · cb6771fb
      Tom Lane 提交于
      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
    • B
      Improve entab's Makefile install entry. · e991930e
      Bruce Momjian 提交于
      Andrew Dunstan
      e991930e
    • B
      Document that not backing up postmaster.pid and postmaster.opts might · 47cacfc0
      Bruce Momjian 提交于
      help prevent pg_ctl from getting confused.
      
      Backpatch to 9.1.
      47cacfc0
    • T
      Consider index-only scans even when there is no matching qual or ORDER BY. · 600d3206
      Tom Lane 提交于
      By popular demand.
      600d3206
    • T
      Rearrange the implementation of index-only scans. · a0185461
      Tom Lane 提交于
      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