Skip to content
Snippets Groups Projects
  1. Aug 20, 2012
  2. Aug 19, 2012
  3. Aug 08, 2012
    • Tom Lane's avatar
      Implement SQL-standard LATERAL subqueries. · 5ebaaa49
      Tom Lane authored
      This patch implements the standard syntax of LATERAL attached to a
      sub-SELECT in FROM, and also allows LATERAL attached to a function in FROM,
      since set-returning function calls are expected to be one of the principal
      use-cases.
      
      The main change here is a rewrite of the mechanism for keeping track of
      which relations are visible for column references while the FROM clause is
      being scanned.  The parser "namespace" lists are no longer lists of bare
      RTEs, but are lists of ParseNamespaceItem structs, which carry an RTE
      pointer as well as some visibility-controlling flags.  Aside from
      supporting LATERAL correctly, this lets us get rid of the ancient hacks
      that required rechecking subqueries and JOIN/ON and function-in-FROM
      expressions for invalid references after they were initially parsed.
      Invalid column references are now always correctly detected on sight.
      
      In passing, remove assorted parser error checks that are now dead code by
      virtue of our having gotten rid of add_missing_from, as well as some
      comments that are obsolete for the same reason.  (It was mainly
      add_missing_from that caused so much fudging here in the first place.)
      
      The planner support for this feature is very minimal, and will be improved
      in future patches.  It works well enough for testing purposes, though.
      
      catversion bump forced due to new field in RangeTblEntry.
      5ebaaa49
  4. Jul 18, 2012
    • Robert Haas's avatar
      Syntax support and documentation for event triggers. · 3855968f
      Robert Haas authored
      They don't actually do anything yet; that will get fixed in a
      follow-on commit.  But this gets the basic infrastructure in place,
      including CREATE/ALTER/DROP EVENT TRIGGER; support for COMMENT,
      SECURITY LABEL, and ALTER EXTENSION .. ADD/DROP EVENT TRIGGER;
      pg_dump and psql support; and documentation for the anticipated
      initial feature set.
      
      Dimitri Fontaine, with review and a bunch of additional hacking by me.
      Thom Brown extensively reviewed earlier versions of this patch set,
      but there's not a whole lot of that code left in this commit, as it
      turns out.
      3855968f
  5. Jul 05, 2012
  6. Apr 30, 2012
    • Tom Lane's avatar
      Converge all SQL-level statistics timing values to float8 milliseconds. · 809e7e21
      Tom Lane authored
      This patch adjusts the core statistics views to match the decision already
      taken for pg_stat_statements, that values representing elapsed time should
      be represented as float8 and measured in milliseconds.  By using float8,
      we are no longer tied to a specific maximum precision of timing data.
      (Internally, it's still microseconds, but we could now change that without
      needing changes at the SQL level.)
      
      The columns affected are
      pg_stat_bgwriter.checkpoint_write_time
      pg_stat_bgwriter.checkpoint_sync_time
      pg_stat_database.blk_read_time
      pg_stat_database.blk_write_time
      pg_stat_user_functions.total_time
      pg_stat_user_functions.self_time
      pg_stat_xact_user_functions.total_time
      pg_stat_xact_user_functions.self_time
      
      The first four of these are new in 9.2, so there is no compatibility issue
      from changing them.  The others require a release note comment that they
      are now double precision (and can show a fractional part) rather than
      bigint as before; also their underlying statistics functions now match
      the column definitions, instead of returning bigint microseconds.
      809e7e21
    • Tom Lane's avatar
      Rename I/O timing statistics columns to blk_read_time and blk_write_time. · 1dd89ead
      Tom Lane authored
      This seems more consistent with the pre-existing choices for names of
      other statistics columns.  Rename assorted internal identifiers to match.
      1dd89ead
  7. Apr 06, 2012
  8. Apr 05, 2012
  9. Mar 04, 2012
    • Tom Lane's avatar
      Collect and use element-frequency statistics for arrays. · 0e5e167a
      Tom Lane authored
      This patch improves selectivity estimation for the array <@, &&, and @>
      (containment and overlaps) operators.  It enables collection of statistics
      about individual array element values by ANALYZE, and introduces
      operator-specific estimators that use these stats.  In addition,
      ScalarArrayOpExpr constructs of the forms "const = ANY/ALL (array_column)"
      and "const <> ANY/ALL (array_column)" are estimated by treating them as
      variants of the containment operators.
      
      Since we still collect scalar-style stats about the array values as a
      whole, the pg_stats view is expanded to show both these stats and the
      array-style stats in separate columns.  This creates an incompatible change
      in how stats for tsvector columns are displayed in pg_stats: the stats
      about lexemes are now displayed in the array-related columns instead of the
      original scalar-related columns.
      
      There are a few loose ends here, notably that it'd be nice to be able to
      suppress either the scalar-style stats or the array-element stats for
      columns for which they're not useful.  But the patch is in good enough
      shape to commit for wider testing.
      
      Alexander Korotkov, reviewed by Noah Misch and Nathan Boley
      0e5e167a
  10. Feb 19, 2012
    • Andrew Dunstan's avatar
      Improve pretty printing of viewdefs. · 2f582f76
      Andrew Dunstan authored
      Some line feeds are added to target lists and from lists to make
      them more readable. By default they wrap at 80 columns if possible,
      but the wrap column is also selectable - if 0 it wraps after every
      item.
      
      Andrew Dunstan, reviewed by Hitoshi Harada.
      2f582f76
  11. Jan 26, 2012
  12. Jan 19, 2012
    • Magnus Hagander's avatar
      Separate state from query string in pg_stat_activity · 4f42b546
      Magnus Hagander authored
      This separates the state (running/idle/idleintransaction etc) into
      it's own field ("state"), and leaves the query field containing just
      query text.
      
      The query text will now mean "current query" when a query is running
      and "last query" in other states. Accordingly,the field has been
      renamed from current_query to query.
      
      Since backwards compatibility was broken anyway to make that, the procpid
      field has also been renamed to pid - along with the same field in
      pg_stat_replication for consistency.
      
      Scott Mead and Magnus Hagander, review work from Greg Smith
      4f42b546
  13. Jul 20, 2011
    • Robert Haas's avatar
      Support SECURITY LABEL on databases, tablespaces, and roles. · 463f2625
      Robert Haas authored
      This requires a new shared catalog, pg_shseclabel.
      
      Along the way, fix the security_label regression tests so that they
      don't monkey with the labels of any pre-existing objects.  This is
      unlikely to matter in practice, since only the label for the "dummy"
      provider was being manipulated.  But this way still seems cleaner.
      
      KaiGai Kohei, with fairly extensive hacking by me.
      463f2625
  14. Jul 18, 2011
    • Robert Haas's avatar
      Create a "fast path" for acquiring weak relation locks. · 3cba8999
      Robert Haas authored
      When an AccessShareLock, RowShareLock, or RowExclusiveLock is requested
      on an unshared database relation, and we can verify that no conflicting
      locks can possibly be present, record the lock in a per-backend queue,
      stored within the PGPROC, rather than in the primary lock table.  This
      eliminates a great deal of contention on the lock manager LWLocks.
      
      This patch also refactors the interface between GetLockStatusData() and
      pg_lock_status() to be a bit more abstract, so that we don't rely so
      heavily on the lock manager's internal representation details.  The new
      fast path lock structures don't have a LOCK or PROCLOCK structure to
      return, so we mustn't depend on that for purposes of listing outstanding
      locks.
      
      Review by Jeff Davis.
      3cba8999
  15. Mar 06, 2011
    • Simon Riggs's avatar
      Efficient transaction-controlled synchronous replication. · a8a8a3e0
      Simon Riggs authored
      If a standby is broadcasting reply messages and we have named
      one or more standbys in synchronous_standby_names then allow
      users who set synchronous_replication to wait for commit, which
      then provides strict data integrity guarantees. Design avoids
      sending and receiving transaction state information so minimises
      bookkeeping overheads. We synchronize with the highest priority
      standby that is connected and ready to synchronize. Other standbys
      can be defined to takeover in case of standby failure.
      
      This version has very strict behaviour; more relaxed options
      may be added at a later date.
      
      Simon Riggs and Fujii Masao, with reviews by Yeb Havinga, Jaime
      Casanova, Heikki Linnakangas and Robert Haas, plus the assistance
      of many other design reviewers.
      a8a8a3e0
  16. Mar 04, 2011
    • Tom Lane's avatar
      Allow non-superusers to create (some) extensions. · 8d3b421f
      Tom Lane authored
      Remove the unconditional superuser permissions check in CREATE EXTENSION,
      and instead define a "superuser" extension property, which when false
      (not the default) skips the superuser permissions check.  In this case
      the calling user only needs enough permissions to execute the commands
      in the extension's installation script.  The superuser property is also
      enforced in the same way for ALTER EXTENSION UPDATE cases.
      
      In other ALTER EXTENSION cases and DROP EXTENSION, test ownership of
      the extension rather than superuserness.  ALTER EXTENSION ADD/DROP needs
      to insist on ownership of the target object as well; to do that without
      duplicating code, refactor comment.c's big switch for permissions checks
      into a separate function in objectaddress.c.
      
      I also removed the superuserness checks in pg_available_extensions and
      related functions; there's no strong reason why everybody shouldn't
      be able to see that info.
      
      Also invent an IF NOT EXISTS variant of CREATE EXTENSION, and use that
      in pg_dump, so that dumps won't fail for installed-by-default extensions.
      We don't have any of those yet, but we will soon.
      
      This is all per discussion of wrapping the standard procedural languages
      into extensions.  I'll make those changes in a separate commit; this is
      just putting the core infrastructure in place.
      8d3b421f
  17. Feb 28, 2011
  18. Feb 17, 2011
  19. Feb 15, 2011
    • Tom Lane's avatar
      Rearrange extension-related views as per recent discussion. · 555353c0
      Tom Lane authored
      The original design of pg_available_extensions did not consider the
      possibility of version-specific control files.  Split it into two views:
      pg_available_extensions shows information that is generic about an
      extension, while pg_available_extension_versions shows all available
      versions together with information that could be version-dependent.
      Also, add an SRF pg_extension_update_paths() to assist in checking that
      a collection of update scripts provide sane update path sequences.
      555353c0
  20. Feb 10, 2011
  21. Feb 08, 2011
    • Tom Lane's avatar
      Core support for "extensions", which are packages of SQL objects. · d9572c4e
      Tom Lane authored
      This patch adds the server infrastructure to support extensions.
      There is still one significant loose end, namely how to make it play nice
      with pg_upgrade, so I am not yet committing the changes that would make
      all the contrib modules depend on this feature.
      
      In passing, fix a disturbingly large amount of breakage in
      AlterObjectNamespace() and callers.
      
      Dimitri Fontaine, reviewed by Anssi Kääriäinen,
      Itagaki Takahiro, Tom Lane, and numerous others
      d9572c4e
  22. Jan 12, 2011
  23. Jan 07, 2011
  24. Jan 03, 2011
  25. Jan 02, 2011
    • Robert Haas's avatar
      Basic foreign table support. · 0d692a0d
      Robert Haas authored
      Foreign tables are a core component of SQL/MED.  This commit does
      not provide a working SQL/MED infrastructure, because foreign tables
      cannot yet be queried.  Support for foreign table scans will need to
      be added in a future patch.  However, this patch creates the necessary
      system catalog structure, syntax support, and support for ancillary
      operations such as COMMENT and SECURITY LABEL.
      
      Shigeru Hanada, heavily revised by Robert Haas
      0d692a0d
  26. Dec 29, 2010
    • Magnus Hagander's avatar
      Add REPLICATION privilege for ROLEs · 9b8aff8c
      Magnus Hagander authored
      This privilege is required to do Streaming Replication, instead of
      superuser, making it possible to set up a SR slave that doesn't
      have write permissions on the master.
      
      Superuser privileges do NOT override this check, so in order to
      use the default superuser account for replication it must be
      explicitly granted the REPLICATION permissions. This is backwards
      incompatible change, in the interest of higher default security.
      9b8aff8c
  27. Nov 23, 2010
  28. Nov 15, 2010
    • Robert Haas's avatar
      Add new buffers_backend_fsync field to pg_stat_bgwriter. · 3134d886
      Robert Haas authored
      This new field counts the number of times that a backend which writes a
      buffer out to the OS must also fsync() it.  This happens when the
      bgwriter fsync request queue is full, and is generally detrimental to
      performance, so it's good to know when it's happening.  Along the way,
      log a new message at level DEBUG1 whenever we fail to hand off an fsync,
      so that the problem can also be seen in examination of log files
      (if the logging level is cranked up high enough).
      
      Greg Smith, with minor tweaks by me.
      3134d886
  29. Sep 28, 2010
    • Robert Haas's avatar
      Add a SECURITY LABEL command. · 4d355a83
      Robert Haas authored
      This is intended as infrastructure to support integration with label-based
      mandatory access control systems such as SE-Linux. Further changes (mostly
      hooks) will be needed, but this is a big chunk of it.
      
      KaiGai Kohei and Robert Haas
      4d355a83
  30. Aug 21, 2010
  31. Aug 08, 2010
  32. Apr 26, 2010
  33. Dec 29, 2009
  34. Nov 29, 2009
  35. Oct 08, 2009
    • Alvaro Herrera's avatar
      Make it possibly to specify GUC params per user and per database. · 2eda8dfb
      Alvaro Herrera authored
      Create a new catalog pg_db_role_setting where they are now stored, and better
      encapsulate the code that deals with settings into its realm.  The old
      datconfig and rolconfig columns are removed.
      
      psql has gained a \drds command to display the settings.
      
      Backwards compatibility warning: while the backwards-compatible system views
      still have the config columns, they no longer completely represent the
      configuration for a user or database.
      
      Catalog version bumped.
      2eda8dfb
Loading