1. 27 May, 2010 1 commit
    • Tom Lane's avatar
      Fix the volatility marking of textanycat() and anytextcat(): they were marked · c82d931d
      Tom Lane authored
      immutable, but that is wrong in general because the cast from the polymorphic
      argument to text could be stable or even volatile.  Mark them volatile for
      safety.  In the typical case where the cast isn't volatile, the planner will
      deduce the correct expression volatility after inlining the function, so
      performance is not lost.  The just-committed fix in CREATE INDEX also ensures
      this won't break any indexing cases that ought to be allowed.
      
      Per discussion, I'm not bumping catversion for this change, as it doesn't
      seem critical enough to force an initdb on beta testers.
      c82d931d
  2. 26 Feb, 2010 1 commit
  3. 16 Feb, 2010 1 commit
    • Tom Lane's avatar
      Replace the pg_listener-based LISTEN/NOTIFY mechanism with an in-memory queue. · d1e02722
      Tom Lane authored
      In addition, add support for a "payload" string to be passed along with
      each notify event.
      
      This implementation should be significantly more efficient than the old one,
      and is also more compatible with Hot Standby usage.  There is not yet any
      facility for HS slaves to receive notifications generated on the master,
      although such a thing is possible in future.
      
      Joachim Wieland, reviewed by Jeff Davis; also hacked on by me.
      d1e02722
  4. 07 Feb, 2010 1 commit
    • Tom Lane's avatar
      Create a "relation mapping" infrastructure to support changing the relfilenodes · b9b8831a
      Tom Lane authored
      of shared or nailed system catalogs.  This has two key benefits:
      
      * The new CLUSTER-based VACUUM FULL can be applied safely to all catalogs.
      
      * We no longer have to use an unsafe reindex-in-place approach for reindexing
        shared catalogs.
      
      CLUSTER on nailed catalogs now works too, although I left it disabled on
      shared catalogs because the resulting pg_index.indisclustered update would
      only be visible in one database.
      
      Since reindexing shared system catalogs is now fully transactional and
      crash-safe, the former special cases in REINDEX behavior have been removed;
      shared catalogs are treated the same as non-shared.
      
      This commit does not do anything about the recently-discussed problem of
      deadlocks between VACUUM FULL/CLUSTER on a system catalog and other
      concurrent queries; will address that in a separate patch.  As a stopgap,
      parallel_schedule has been tweaked to run vacuum.sql by itself, to avoid
      such failures during the regression tests.
      b9b8831a
  5. 01 Feb, 2010 1 commit
  6. 28 Jan, 2010 1 commit
  7. 25 Jan, 2010 1 commit
  8. 19 Jan, 2010 2 commits
  9. 15 Jan, 2010 1 commit
    • Heikki Linnakangas's avatar
      Introduce Streaming Replication. · 40f908bd
      Heikki Linnakangas authored
      This includes two new kinds of postmaster processes, walsenders and
      walreceiver. Walreceiver is responsible for connecting to the primary server
      and streaming WAL to disk, while walsender runs in the primary server and
      streams WAL from disk to the client.
      
      Documentation still needs work, but the basics are there. We will probably
      pull the replication section to a new chapter later on, as well as the
      sections describing file-based replication. But let's do that as a separate
      patch, so that it's easier to see what has been added/changed. This patch
      also adds a new section to the chapter about FE/BE protocol, documenting the
      protocol used by walsender/walreceivxer.
      
      Bump catalog version because of two new functions,
      pg_last_xlog_receive_location() and pg_last_xlog_replay_location(), for
      monitoring the progress of replication.
      
      Fujii Masao, with additional hacking by me
      40f908bd
  10. 14 Jan, 2010 1 commit
  11. 07 Jan, 2010 1 commit
  12. 05 Jan, 2010 1 commit
    • Tom Lane's avatar
      Get rid of the need for manual maintenance of the initial contents of · 64737e93
      Tom Lane authored
      pg_attribute, by having genbki.pl derive the information from the various
      catalog header files.  This greatly simplifies modification of the
      "bootstrapped" catalogs.
      
      This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely entirely on
      Perl scripts for those build steps.  To avoid creating a Perl build dependency
      where there was not one before, the output files generated by these scripts
      are now treated as distprep targets, ie, they will be built and shipped in
      tarballs.  But you will need a reasonably modern Perl (probably at least
      5.6) if you want to build from a CVS pull.
      
      The changes to the MSVC build process are untested, and may well break ---
      we'll soon find out from the buildfarm.
      
      John Naylor, based on ideas from Robert Haas and others
      64737e93
  13. 02 Jan, 2010 1 commit
  14. 19 Dec, 2009 1 commit
    • Simon Riggs's avatar
      Allow read only connections during recovery, known as Hot Standby. · efc16ea5
      Simon Riggs authored
      Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record.
      
      New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far.
      
      This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required.
      
      Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit.
      
      Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
      efc16ea5
  15. 06 Dec, 2009 1 commit
  16. 05 Dec, 2009 1 commit
    • Peter Eisentraut's avatar
      Speed up information schema privilege views · 36f887c4
      Peter Eisentraut authored
      Instead of expensive cross joins to resolve the ACL, add table-returning
      function aclexplode() that expands the ACL into a useful form, and join
      against that.
      
      Also, implement the role_*_grants views as a thin layer over the respective
      *_privileges views instead of essentially repeating the same code twice.
      
      fixes bug #4596
      
      by Joachim Wieland, with cleanup by me
      36f887c4
  17. 29 Nov, 2009 1 commit
  18. 28 Nov, 2009 1 commit
  19. 09 Oct, 2009 1 commit
    • Peter Eisentraut's avatar
      Use pg_get_triggerdef in pg_dump · b865d275
      Peter Eisentraut authored
      Add a variant of pg_get_triggerdef with a second argument "pretty" that
      causes the output to be formatted in the way pg_dump used to do.  Use this
      variant in pg_dump with server versions >= 8.5.
      
      This insulates pg_dump from most future trigger feature additions, such as
      the upcoming column triggers patch.
      
      Author: Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>
      b865d275
  20. 26 Sep, 2009 1 commit
    • Tom Lane's avatar
      Extend the BKI infrastructure to allow system catalogs to be given · 49856352
      Tom Lane authored
      hand-assigned rowtype OIDs, even when they are not "bootstrapped" catalogs
      that have handmade type rows in pg_type.h.  Give pg_database such an OID.
      Restore the availability of C macros for the rowtype OIDs of the bootstrapped
      catalogs.  (These macros are now in the individual catalogs' .h files,
      though, not in pg_type.h.)
      
      This commit doesn't do anything especially useful by itself, but it's
      necessary infrastructure for reverting some ill-considered changes in
      relcache.c.
      49856352
  21. 01 Sep, 2009 1 commit
    • Alvaro Herrera's avatar
      Remove flatfiles.c, which is now obsolete. · a8bb8eb5
      Alvaro Herrera authored
      Recent commits have removed the various uses it was supporting.  It was a
      performance bottleneck, according to bug report #4919 by Lauris Ulmanis; seems
      it slowed down user creation after a billion users.
      a8bb8eb5
  22. 04 Aug, 2009 1 commit
    • Tom Lane's avatar
      Cause pg_proc.probin to be declared as text, not bytea. Everything was · f192e4a5
      Tom Lane authored
      already treating it as text anyway, to the point that I couldn't find anything
      to change except the datatype markings in catalog/*.h.  The only effect that
      the bytea declaration had was to cause byteaout() to be invoked when pg_dump
      (or another client program) inspected the column value.  Since pg_dump wasn't
      expecting that, but just treating what it got as text, the net result is that
      dump and reload would mangle any backslashes or non-ASCII characters in the
      filename string for a C-language function.  That is a very long-standing bug,
      but given the lack of field complaints it doesn't seem worth trying to find
      a back-patchable fix.  We'll just make this change to fix it going forward.
      
      This change will also forestall problems after the planned change to let bytea
      emit hex output instead of escaped characters.
      f192e4a5
  23. 03 Aug, 2009 1 commit
    • Joe Conway's avatar
      Implement has_sequence_privilege() · be6bca23
      Joe Conway authored
      Add family of functions that did not exist earlier,
      mainly due to historical omission. Original patch by
      Abhijit Menon-Sen, with review and modifications by
      Joe Conway. catversion.h bumped.
      be6bca23
  24. 29 Jul, 2009 1 commit
    • Tom Lane's avatar
      Support deferrable uniqueness constraints. · 25d9bf2e
      Tom Lane authored
      The current implementation fires an AFTER ROW trigger for each tuple that
      looks like it might be non-unique according to the index contents at the
      time of insertion.  This works well as long as there aren't many conflicts,
      but won't scale to massive unique-key reassignments.  Improving that case
      is a TODO item.
      
      Dean Rasheed
      25d9bf2e
  25. 07 Jul, 2009 2 commits
    • Tom Lane's avatar
      Fix typo in comment. · 8fe8ac5f
      Tom Lane authored
      8fe8ac5f
    • Peter Eisentraut's avatar
      More sensible character_octet_length · e292dbcf
      Peter Eisentraut authored
      For character types with typmod, character_octet_length columns in the
      information schema now show the maximum character length times the
      maximum length of a character in the server encoding, instead of some
      huge value as before.
      e292dbcf
  26. 11 Jun, 2009 1 commit
  27. 09 Jun, 2009 1 commit
    • Tom Lane's avatar
      Mark internal_in as not strict, so that the construct "null::internal" · e343eaaf
      Tom Lane authored
      will throw an error, rather than possibly allowing someone to synthesize
      a manual call to an internal-accepting function.  As of CVS HEAD and existing
      releases, all such functions are either STRICT or careful about null inputs,
      so there is no current security issue here.  But it seems like a good idea
      to lock this down to protect against future mistakes.
      
      In passing, similarly lock down trigger_in, language_handler_in, opaque_in,
      and shell_in.  These are not believed to present any security risk, but
      there's still no good reason to allow nulls of these types to be created.
      I left the polymorphic pseudotypes (anyelement etc) alone, since a null
      of one of those types doesn't seem to be a problem --- the worst you can
      say about it is that it doesn't have an underlying non-polymorphic type.
      
      If we were to make this change during normal development, we'd just
      automatically bump catversion for a pg_proc.h change.  But since this doesn't
      create a compatibility risk and isn't believed to be fixing a live bug, it
      seems better not to force a catversion bump in late beta.
      e343eaaf
  28. 09 Apr, 2009 1 commit
  29. 07 Apr, 2009 1 commit
  30. 05 Apr, 2009 1 commit
  31. 25 Mar, 2009 1 commit
    • Tom Lane's avatar
      Adjust the APIs for GIN opclass support functions to allow the extractQuery() · 87b8db37
      Tom Lane authored
      method to pass extra data to the consistent() and comparePartial() methods.
      This is the core infrastructure needed to support the soon-to-appear
      contrib/btree_gin module.  The APIs are still upward compatible with the
      definitions used in 8.3 and before, although *not* with the previous 8.4devel
      function definitions.
      
      catversion bump for changes in pg_proc entries (although these are just
      cosmetic, since GIN doesn't actually look at the function signature before
      calling it...)
      
      Teodor Sigaev and Oleg Bartunov
      87b8db37
  32. 24 Mar, 2009 1 commit
    • Tom Lane's avatar
      Implement "fastupdate" support for GIN indexes, in which we try to accumulate · ff301d6e
      Tom Lane authored
      multiple index entries in a holding area before adding them to the main index
      structure.  This helps because bulk insert is (usually) significantly faster
      than retail insert for GIN.
      
      This patch also removes GIN support for amgettuple-style index scans.  The
      API defined for amgettuple is difficult to support with fastupdate, and
      the previously committed partial-match feature didn't really work with
      it either.  We might eventually figure a way to put back amgettuple
      support, but it won't happen for 8.4.
      
      catversion bumped because of change in GIN's pg_am entry, and because
      the format of GIN indexes changed on-disk (there's a metapage now,
      and possibly a pending list).
      
      Teodor Sigaev
      ff301d6e
  33. 24 Feb, 2009 1 commit
  34. 06 Feb, 2009 1 commit
    • Tom Lane's avatar
      Clean up some loose ends from the column privileges patch: add · 7449427a
      Tom Lane authored
      has_column_privilege and has_any_column_privilege SQL functions; fix the
      information_schema views that are supposed to pay attention to column
      privileges; adjust pg_stats to show stats for any column you have select
      privilege on; and fix COPY to allow copying a subset of columns if the user
      has suitable per-column privileges for all the columns.
      
      To improve efficiency of some of the information_schema views, extend the
      has_xxx_privilege functions to allow inquiring about the OR of a set of
      privileges in just one call.  This is just exposing capability that already
      existed in the underlying aclcheck routines.
      
      In passing, make the information_schema views report the owner's own
      privileges as being grantable, since Postgres assumes this even when the grant
      option bit is not set in the ACL.  This is a longstanding oversight.
      
      Also, make the new has_xxx_privilege functions for foreign data objects follow
      the same coding conventions used by the older ones.
      
      Stephen Frost and Tom Lane
      7449427a
  35. 01 Jan, 2009 1 commit
  36. 28 Dec, 2008 1 commit
  37. 19 Dec, 2008 2 commits