Skip to content
Snippets Groups Projects
  1. Apr 05, 2005
  2. Apr 01, 2005
  3. Mar 29, 2005
    • Tom Lane's avatar
      Convert oidvector and int2vector into variable-length arrays. This · 70c9763d
      Tom Lane authored
      change saves a great deal of space in pg_proc and its primary index,
      and it eliminates the former requirement that INDEX_MAX_KEYS and
      FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
      in the on-disk representation (because it affects index tuple header
      size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
      to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
      There are still a lot of vestigial references to FUNC_MAX_ARGS, which
      I will clean up in a separate pass.  However, getting rid of it
      altogether would require changing the FunctionCallInfoData struct,
      and I'm not sure I want to buy into that.
      70c9763d
  4. Mar 26, 2005
  5. Mar 24, 2005
    • Tom Lane's avatar
      Tweak planner to use a minimum size estimate of 10 pages for a · 208ec47b
      Tom Lane authored
      never-yet-vacuumed relation.  This restores the pre-8.0 behavior of
      avoiding seqscans during initial data loading, while still allowing
      reasonable optimization after a table has been vacuumed.  Several
      regression test cases revert to 7.4-like behavior, which is probably
      a good sign.  Per gripes from Keith Browne and others.
      208ec47b
  6. Mar 16, 2005
  7. Mar 14, 2005
  8. Mar 11, 2005
    • Tom Lane's avatar
      Make the behavior of HAVING without GROUP BY conform to the SQL spec. · 595ed2a8
      Tom Lane authored
      Formerly, if such a clause contained no aggregate functions we mistakenly
      treated it as equivalent to WHERE.  Per spec it must cause the query to
      be treated as a grouped query of a single group, the same as appearance
      of aggregate functions would do.  Also, the HAVING filter must execute
      after aggregate function computation even if it itself contains no
      aggregate functions.
      595ed2a8
  9. Mar 07, 2005
  10. Feb 28, 2005
  11. Feb 22, 2005
    • Neil Conway's avatar
      This patch changes makes some significant changes to how compilation · 5a9dd0dc
      Neil Conway authored
      and parsing work in PL/PgSQL:
      
      - memory management is now done via palloc(). The compiled representation
        of each function now has its own memory context. Therefore, the storage
        consumed by a function can be reclaimed via MemoryContextDelete().
      
        During compilation, the CurrentMemoryContext is the function's memory
        context. This means that a palloc() is sufficient to allocate memory
        that will have the same lifetime as the function itself. As a result,
        code invoked during compilation should be careful to pfree() temporary
        allocations to avoid leaking memory. Since a lot of the code in the
        backend is not careful about releasing palloc'ed memory, that means
        we should switch into a temporary memory context before invoking
        backend functions. A temporary context appropriate for such allocations
        is `compile_tmp_cxt'.
      
      - The ability to use palloc() allows us to simply a lot of the code in
        the parser. Rather than representing lists of elements via ad hoc
        linked lists or arrays, we can use the List type. Rather than doing
        malloc followed by memset(0), we can just use palloc0().
      
      - We now check that the user has supplied the right number of parameters
        to a RAISE statement. Supplying either too few or too many results in
        an error (at runtime).
      
      - PL/PgSQL's parser needs to accept arbitrary SQL statements. Since we
        do not want to duplicate the SQL grammar in the PL/PgSQL grammar, this
        means we need to be quite lax in what the PL/PgSQL grammar considers
        a "SQL statement". This can lead to misleading behavior if there is a
        syntax error in the function definition, since we assume a malformed
        PL/PgSQL construct is a SQL statement. Furthermore, these errors were
        only detected at runtime (when we tried to execute the alleged "SQL
        statement" via SPI).
      
        To rectify this, the patch changes the parser to invoke the main SQL
        parser when it sees a string it believes to be a SQL expression. This
        means that synctically-invalid SQL will be rejected during the
        compilation of the PL/PgSQL function. This is only done when compiling
        for "validation" purposes (i.e. at CREATE FUNCTION time), so it should
        not impose a runtime overhead.
      
      - Fixes for the various buffer overruns I've patched in stable branches
        in the past few weeks. I've rewritten code where I thought it was
        warranted (unlike the patches applied to older branches, which were
        minimally invasive).
      
      - Various other minor changes and cleanups.
      
      - Updates to the regression tests.
      5a9dd0dc
  12. Feb 11, 2005
  13. Feb 02, 2005
  14. Jan 28, 2005
    • Tom Lane's avatar
      When dealing with multiple grouping columns coming from the same table, · 875b0c62
      Tom Lane authored
      clamp the estimated number of groups to table row count over 10, instead
      of table row count; this reflects a heuristic that people probably won't
      group over a near-unique set of columns, and the knowledge that we don't
      currently have any way to estimate the correlation of the columns better
      than guessing.  This change creates a trivial plan change in one of the
      regression tests.
      875b0c62
  15. Jan 27, 2005
  16. Jan 25, 2005
  17. Jan 22, 2005
  18. Jan 19, 2005
  19. Jan 17, 2005
  20. Jan 15, 2005
    • Tom Lane's avatar
      pg_regress now needs to know that Windows hasn't got unix sockets, · 7a6a7d57
      Tom Lane authored
      per Andrew Dunstan.  Also, don't override the user's value of PGHOST
      in the 'make installcheck' case.  I think the latter was an ill-considered
      workaround for the Windows code back when libpq didn't properly default
      to localhost on Unix-socket-less platforms.
      7a6a7d57
  21. Jan 12, 2005
  22. Dec 23, 2004
  23. Dec 21, 2004
  24. Dec 19, 2004
  25. Dec 12, 2004
  26. Dec 03, 2004
  27. Dec 02, 2004
    • Tom Lane's avatar
      Make some adjustments to reduce platform dependencies in plan selection. · 4e91824b
      Tom Lane authored
      In particular, there was a mathematical tie between the two possible
      nestloop-with-materialized-inner-scan plans for a join (ie, we computed
      the same cost with either input on the inside), resulting in a roundoff
      error driven choice, if the relations were both small enough to fit in
      sort_mem.  Add a small cost factor to ensure we prefer materializing the
      smaller input.  This changes several regression test plans, but with any
      luck we will now have more stability across platforms.
      4e91824b
  28. Dec 01, 2004
    • Tom Lane's avatar
      Change planner to use the current true disk file size as its estimate of · 5374d097
      Tom Lane authored
      a relation's number of blocks, rather than the possibly-obsolete value
      in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
      to arrive at a hopefully more accurate number of rows.  When pg_class
      contains 0/0, estimate a tuple width from the column datatypes and divide
      that into current file size to estimate number of rows.  This improved
      methodology allows us to jettison the ancient hacks that put bogus default
      values into pg_class when a table is first created.  Also, per a suggestion
      from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
      it puts into pg_class.reltuples to try to represent the mean tuple density
      instead of the minimal density that actually prevails just after VACUUM.
      These changes alter the plans selected for certain regression tests, so
      update the expected files accordingly.  (I removed join_1.out because
      it's not clear if it still applies; we can add back any variant versions
      as they are shown to be needed.)
      5374d097
  29. Nov 17, 2004
  30. Nov 16, 2004
    • Tom Lane's avatar
      Rethink plpgsql's way of handling SPI execution during an exception block. · 7efa8411
      Tom Lane authored
      We don't really want to start a new SPI connection, just keep using the old
      one; otherwise we have memory management problems as illustrated by
      John Kennedy's bug report of today.  This requires a bit of a hack to
      ensure the SPI stack state is properly restored, but then again what we
      were doing before was a hack too, strictly speaking.  Add a regression
      test to cover this case.
      7efa8411
  31. Nov 05, 2004
    • 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
Loading