1. 09 May, 2005 1 commit
    • Neil Conway's avatar
      Complete the following TODO items: · 4744c1a0
      Neil Conway authored
      * Add session start time to pg_stat_activity
      * Add the client IP address and port to pg_stat_activity
      
      Original patch from Magnus Hagander, code review by Neil Conway. Catalog
      version bumped. This patch sends the client IP address and port number in
      every statistics message; that's not ideal, but will be fixed up shortly.
      4744c1a0
  2. 30 Apr, 2005 1 commit
  3. 14 Apr, 2005 1 commit
    • 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
  4. 12 Apr, 2005 1 commit
    • Tom Lane's avatar
      Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can · 2e7a6889
      Tom Lane authored
      be supported for all datatypes.  Add CREATE AGGREGATE and pg_dump support
      too.  Add specialized min/max aggregates for bpchar, instead of depending
      on text's min/max, because otherwise the possible use of bpchar indexes
      cannot be recognized.
      initdb forced because of catalog changes.
      2e7a6889
  5. 31 Mar, 2005 1 commit
  6. 29 Mar, 2005 2 commits
    • Tom Lane's avatar
      Add proallargtypes and proargmodes columns to pg_proc, as per my earlier · 0f085f6e
      Tom Lane authored
      proposal for OUT parameter support.  The columns don't actually *do*
      anything yet, they are just left NULLs.  But I thought I'd commit this
      part separately as a fairly pure example of the tasks needed when adding
      a column to pg_proc or one of the other core system tables.
      0f085f6e
    • 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
  7. 27 Mar, 2005 1 commit
    • Tom Lane's avatar
      First steps towards index scans with heap access decoupled from index · bf3dbb58
      Tom Lane authored
      access: define new index access method functions 'amgetmulti' that can
      fetch multiple TIDs per call.  (The functions exist but are totally
      untested as yet.)  Since I was modifying pg_am anyway, remove the
      no-longer-needed 'rel' parameter from amcostestimate functions, and
      also remove the vestigial amowner column that was creating useless
      work for Alvaro's shared-object-dependencies project.
      Initdb forced due to changes in pg_am.
      bf3dbb58
  8. 21 Mar, 2005 1 commit
    • Tom Lane's avatar
      Convert index-related tuple handling routines from char 'n'/' ' to bool · ee4ddac1
      Tom Lane authored
      convention for isnull flags.  Also, remove the useless InsertIndexResult
      return struct from index AM aminsert calls --- there is no reason for
      the caller to know where in the index the tuple was inserted, and we
      were wasting a palloc cycle per insert to deliver this uninteresting
      value (plus nontrivial complexity in some AMs).
      I forced initdb because of the change in the signature of the aminsert
      routines, even though nothing really looks at those pg_proc entries...
      ee4ddac1
  9. 28 Feb, 2005 1 commit
  10. 27 Feb, 2005 1 commit
  11. 26 Feb, 2005 1 commit
    • Tom Lane's avatar
      Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack · 0fc4ecf9
      Tom Lane authored
      in favor of looking at the flat file copy of pg_database during backend
      startup.  This should finally eliminate the various corner cases in which
      backend startup fails unexpectedly because it isn't able to distinguish
      live and dead tuples in pg_database.  Simplify locking on pg_database
      to be similar to the rules used with pg_shadow and pg_group, and eliminate
      FlushRelationBuffers operations that were used only to reduce the odds
      of failure of GetRawDatabaseInfo.
      initdb forced due to addition of a trigger to pg_database.
      0fc4ecf9
  12. 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
  13. 07 Oct, 2004 1 commit
    • Tom Lane's avatar
      Fix problems with SQL functions returning rowtypes that have dropped · a8487e15
      Tom Lane authored
      columns.  The returned tuple needs to have appropriate NULL columns
      inserted so that it actually matches the declared rowtype.  It seemed
      convenient to use a JunkFilter for this, so I made some cleanups and
      simplifications in the JunkFilter code to allow it to support this
      additional functionality.  (That in turn exposed a latent bug in
      nodeAppend.c, which is that it was returning a tuple slot whose
      descriptor didn't match its data.)  Also, move check_sql_fn_retval
      out of pg_proc.c and into functions.c, where it seems to more naturally
      belong.
      a8487e15
  14. 04 Oct, 2004 2 commits
  15. 29 Aug, 2004 2 commits
  16. 03 Aug, 2004 1 commit
    • Tom Lane's avatar
      Add functions pg_start_backup, pg_stop_backup to create backup label · 58c41712
      Tom Lane authored
      and history files as per recent discussion.  While at it, remove
      pg_terminate_backend, since we have decided we do not have time during
      this release cycle to address the reliability concerns it creates.
      Split the 'Miscellaneous Functions' documentation section into
      'System Information Functions' and 'System Administration Functions',
      which hopefully will draw the eyes of those looking for such things.
      58c41712
  17. 12 Jul, 2004 1 commit
  18. 02 Jul, 2004 2 commits
    • Tom Lane's avatar
      Add missing operators of the form interval-plus-datetime, as required for · e34082ee
      Tom Lane authored
      better SQL compliance in this area, per recent discussion.  Mark related
      operators as commutators where possible.  (The system doesn't actually care
      about commutator marking for operators not returning boolean, at the moment,
      but this seems forward-thinking and besides it made it easier to verify
      that we hadn't missed any.)
      Also, remove interval-minus-time and interval-minus-timetz operators.
      I'm not sure how these got in, but they are nonstandard and had very
      obviously broken behavior.  (minus is not commutative in anyone's book.)
      I doubt anyone had ever used 'em, because we'd surely have gotten a bug
      report about it if so.
      e34082ee
    • Joe Conway's avatar
      Andreas Pflug wrote: · 0b89d261
      Joe Conway authored
       From an idea of Bruce, the attached patch implements the function
       pg_tablespace_databases(oid) RETURNS SETOF oid
       which delivers as set of database oids having objects in the selected
       tablespace, enabling an admin to examine only the databases affecting
       the tablespace for objects instead of scanning all of them.
      
      initdb forced
      0b89d261
  19. 25 Jun, 2004 1 commit
  20. 16 Jun, 2004 1 commit
    • Tom Lane's avatar
      Represent type-specific length coercion functions as pg_cast entries, · d70a42e6
      Tom Lane authored
      eliminating the former hard-wired convention about their names.  Allow
      pg_cast entries to represent both type coercion and length coercion in
      a single step --- this is represented by a function that takes an
      extra typmod argument, just like a length coercion function.  This
      nicely merges the type and length coercion mechanisms into something
      at least a little cleaner than we had before.  Make use of the single-
      coercion-step behavior to fix integer-to-bit coercion so that coercing
      to bit(n) yields the rightmost n bits of the integer instead of the
      leftmost n bits.  This should fix recurrent complaints about the odd
      behavior of this coercion.  Clean up the documentation of the bit string
      functions, and try to put it where people might actually find it.
      Also, get rid of the unreliable heuristics in ruleutils.c about whether
      to display nested coercion steps; instead require parse_coerce.c to
      label them properly in the first place.
      d70a42e6
  21. 13 Jun, 2004 2 commits
  22. 06 Jun, 2004 1 commit
  23. 02 Jun, 2004 1 commit
  24. 26 May, 2004 4 commits
    • Bruce Momjian's avatar
    • Bruce Momjian's avatar
      *) inet_(client|server)_(addr|port)() and necessary documentation for · 97d625dd
      Bruce Momjian authored
      the four functions.
      
      
      > Also, please justify the temp-related changes.  I was not aware that we
      > had any breakage there.
      
      patch-tmp-schema.txt contains the following bits:
      
      *) Changes pg_namespace_aclmask() so that the superuser is always able
      to create objects in the temp namespace.
      *) Changes pg_namespace_aclmask() so that if this is a temp namespace,
      objects are only allowed to be created in the temp namespace if the
      user has TEMP privs on the database.  This encompasses all object
      creation, not just TEMP tables.
      *) InitTempTableNamespace() checks to see if the current user, not the
      session user, has access to create a temp namespace.
      
      The first two changes are necessary to support the third change.  Now
      it's possible to revoke all temp table privs from non-super users and
      limiting all creation of temp tables/schemas via a function that's
      executed with elevated privs (security definer).  Before this change,
      it was not possible to have a setuid function to create a temp
      table/schema if the session user had no TEMP privs.
      
      patch-area-path.txt contains:
      
      *) Can now determine the area of a closed path.
      
      
      patch-dfmgr.txt contains:
      
      *) Small tweak to add the library path that's being expanded.
      
      I was using $lib/foo.so and couldn't easily figure out what the error
      message, "invalid macro name in dynamic library path" meant without
      looking through the source code.  With the path in there, at least I
      know where to start looking in my config file.
      
      Sean Chittenden
      97d625dd
    • Bruce Momjian's avatar
      48076192
    • Bruce Momjian's avatar
      The added aggregates are: · 8096fe45
      Bruce Momjian authored
      (1) boolean-and and boolean-or aggregates named bool_and and bool_or.
          they (SHOULD;-) correspond to standard sql every and some/any aggregates.
          they do not have the right name as there is a problem with
          the standard and the parser for some/any. Tom also think that
          the standard name is misleading because NULL are ignored.
          Also add 'every' aggregate.
      
      (2) bitwise integer aggregates named bit_and and bit_or for
          int2, int4, int8 and bit types. They are not standard, but I find
          them useful. I needed them once.
      
      
      The patches adds:
      
      - 2 new very short strict functions for boolean aggregates in
        src/backed/utils/adt/bool.c,
        src/include/utils/builtins.h and src/include/catalog/pg_proc.h
      
      - the new aggregates declared in src/include/catalog/pg_proc.h and
        src/include/catalog/pg_aggregate.h
      
      - some documentation and validation about these new aggregates.
      
      Fabien COELHO
      8096fe45
  25. 14 May, 2004 1 commit
    • Neil Conway's avatar
      Implement the width_bucket() function, per SQL2003. This commit only adds · 0079547b
      Neil Conway authored
      a variant of the function for the 'numeric' datatype; it would be possible
      to add additional variants for other datatypes, but I haven't done so yet.
      
      This commit includes regression tests and minimal documentation; if we
      want developers to actually use this function in applications, we'll
      probably need to document what it does more fully.
      0079547b
  26. 07 May, 2004 1 commit
  27. 02 May, 2004 1 commit
    • Bruce Momjian's avatar
      Revert patch --- needs more generalized solution. · a9d3c2cb
      Bruce Momjian authored
      > Please find a attached a small patch that adds accessor functions
      > for "aclitem" so that it is not an opaque datatype.
      >
      > I needed these functions to browse aclitems from user land. I can load
      > them when necessary, but it seems to me that these accessors for a
      > backend type belong to the backend, so I submit them.
      >
      > Fabien Coelho
      a9d3c2cb
  28. 26 Apr, 2004 1 commit
  29. 23 Apr, 2004 1 commit
    • Neil Conway's avatar
      Add ceiling() as an alias for ceil(), and power() as an alias for pow(). · fc7fd501
      Neil Conway authored
      Regression tests and documentation have both been updated.
      
      SQL2003 requires that both ceiling() and ceil() be present, so I have
      documented both spellings. SQL2003 doesn't mention pow() as far as I
      can see, so I decided to replace pow() with power() in the documentation:
      there is little reason to encourage the continued usage of a function
      that isn't compliant with the standard, given a standard-compliant
      alternative.
      
      RELEASE NOTES: should state that pow() is considered deprecated
      (although I don't see the need to ever remove it.)
      fc7fd501
  30. 02 Apr, 2004 1 commit
  31. 01 Apr, 2004 1 commit
    • Tom Lane's avatar
      Replace TupleTableSlot convention for whole-row variables and function · 375369ac
      Tom Lane authored
      results with tuples as ordinary varlena Datums.  This commit does not
      in itself do much for us, except eliminate the horrid memory leak
      associated with evaluation of whole-row variables.  However, it lays the
      groundwork for allowing composite types as table columns, and perhaps
      some other useful features as well.  Per my proposal of a few days ago.
      375369ac
  32. 22 Mar, 2004 1 commit