1. 18 Jan, 2006 1 commit
    • Neil Conway's avatar
      Add a new system view, pg_cursors, that displays the currently available · 33e06ebc
      Neil Conway authored
      cursors. Patch from Joachim Wieland, review and ediorialization by Neil
      Conway. The view lists cursors defined by DECLARE CURSOR, using SPI, or
      via the Bind message of the frontend/backend protocol. This means the
      view does not list the unnamed portal or the portal created to implement
      EXECUTE. Because we do list SPI portals, there might be more rows in
      this view than you might expect if you are using SPI implicitly (e.g.
      via a procedural language).
      
      Per recent discussion on -hackers, the query string included in the
      view for cursors defined by DECLARE CURSOR is based on
      debug_query_string. That means it is not accurate if multiple queries
      separated by semicolons are submitted as one query string. However,
      there doesn't seem a trivial fix for that: debug_query_string
      is better than nothing. I also changed SPI_cursor_open() to include
      the source text for the portal it creates: AFAICS there is no reason
      not to do this.
      
      Update the documentation and regression tests, bump the catversion.
      33e06ebc
  2. 16 Jan, 2006 1 commit
  3. 08 Jan, 2006 1 commit
    • Neil Conway's avatar
      Add a new system view, pg_prepared_statements, that can be used to · 44b928e8
      Neil Conway authored
      access information about the prepared statements that are available
      in the current session. Original patch from Joachim Wieland, various
      improvements by Neil Conway.
      
      The "statement" column of the view contains the literal query string
      sent by the client, without any rewriting or pretty printing. This
      means that prepared statements created via SQL will be prefixed with
      "PREPARE ... AS ", whereas those prepared via the FE/BE protocol will
      not. That is unfortunate, but discussion on -patches did not yield an
      efficient way to improve this, and there is some merit in returning
      exactly what the client sent to the backend.
      
      Catalog version bumped, regression tests updated.
      44b928e8
  4. 28 Nov, 2005 1 commit
    • Tom Lane's avatar
      Change the parser to translate "foo [NOT] IN (expression-list)" to · 3d376fce
      Tom Lane authored
      ScalarArrayOpExpr when possible, that is, whenever there is an array type
      for the values of the expression list.  This completes the project I've
      been working on to improve the speed of index searches with long IN lists,
      as per discussion back in mid-October.
      
      I did not force initdb, but until you do one you will see failures in the
      "rules" regression test, because some of the standard system views use IN
      and their compiled formats have changed.
      3d376fce
  5. 06 Oct, 2005 1 commit
    • Tom Lane's avatar
      Revise pgstats stuff to fix the problems with not counting accesses · cb8b6618
      Tom Lane authored
      generated by bitmap index scans.  Along the way, simplify and speed up
      the code for counting sequential and index scans; it was both confusing
      and inefficient to be taking care of that in the per-tuple loops, IMHO.
      initdb forced because of internal changes in pg_stat view definitions.
      cb8b6618
  6. 02 Oct, 2005 1 commit
    • Tom Lane's avatar
      Change nextval and other sequence functions to specify their sequence · aa731ed8
      Tom Lane authored
      argument as a 'regclass' value instead of a text string.  The frontend
      conversion of text string to pg_class OID is now encapsulated as an
      implicitly-invocable coercion from text to regclass.  This provides
      backwards compatibility to the old behavior when the sequence argument
      is explicitly typed as 'text'.  When the argument is just an unadorned
      literal string, it will be taken as 'regclass', which means that the
      stored representation will be an OID.  This solves longstanding problems
      with renaming sequences that are referenced in default expressions, as
      well as new-in-8.1 problems with renaming such sequences' schemas or
      moving them to another schema.  All per recent discussion.
      Along the way, fix some rather serious problems in dbmirror's support
      for mirroring sequence operations (int4 vs int8 confusion for instance).
      aa731ed8
  7. 15 Aug, 2005 1 commit
    • Tom Lane's avatar
      Allow the pgstat views to show toast tables as well as regular tables · 87808aef
      Tom Lane authored
      (the stats system has always collected this info, but the views were
      filtering it out).  Modify autovacuum so that over-threshold activity
      in a toast table can trigger a VACUUM of the parent table, even if the
      parent didn't appear to need vacuuming itself.  Per discussion a month
      or so back about "short, wide tables".
      87808aef
  8. 31 Jul, 2005 1 commit
  9. 26 Jul, 2005 1 commit
    • Tom Lane's avatar
      Add a role property 'rolinherit' which, when false, denotes that the role · af019fb9
      Tom Lane authored
      doesn't automatically inherit the privileges of roles it is a member of;
      for such a role, membership in another role can be exploited only by doing
      explicit SET ROLE.  The default inherit setting is TRUE, so by default
      the behavior doesn't change, but creating a user with NOINHERIT gives closer
      adherence to our current reading of SQL99.  Documentation still lacking,
      and I think the information schema needs another look.
      af019fb9
  10. 28 Jun, 2005 2 commits
    • Tom Lane's avatar
      Bring syntax of role-related commands into SQL compliance. To avoid · 0eaa36a1
      Tom Lane authored
      syntactic conflicts, both privilege and role GRANT/REVOKE commands have
      to use the same production for scanning the list of tokens that might
      eventually turn out to be privileges or role names.  So, change the
      existing GRANT/REVOKE code to expect a list of strings not pre-reduced
      AclMode values.  Fix a couple other minor issues while at it, such as
      InitializeAcl function name conflicting with a Windows system function.
      0eaa36a1
    • Tom Lane's avatar
      Replace pg_shadow and pg_group by new role-capable catalogs pg_authid · 7762619e
      Tom Lane authored
      and pg_auth_members.  There are still many loose ends to finish in this
      patch (no documentation, no regression tests, no pg_dump support for
      instance).  But I'm going to commit it now anyway so that Alvaro can
      make some progress on shared dependencies.  The catalog changes should
      be pretty much done.
      7762619e
  11. 18 Jun, 2005 1 commit
    • Tom Lane's avatar
      Add a time-of-preparation column to the pg_prepared_xacts view, per an · a8d1075f
      Tom Lane authored
      old suggestion by Oliver Jowett.  Also, add a transaction column to the
      pg_locks view to show the xid of each transaction holding or awaiting
      locks; this allows prepared transactions to be properly associated with
      the locks they own.  There was already a column named 'transaction',
      and I chose to rename it to 'transactionid' --- since this column is
      new in the current devel cycle there should be no backwards compatibility
      issue to worry about.
      a8d1075f
  12. 17 Jun, 2005 1 commit
  13. 17 May, 2005 1 commit
  14. 09 May, 2005 1 commit
  15. 07 Apr, 2005 1 commit
    • Neil Conway's avatar
      Add a "USING" clause to DELETE, which is equivalent to the FROM clause · f5ab0a14
      Neil Conway authored
      in UPDATE. We also now issue a NOTICE if a query has _any_ implicit
      range table entries -- in the past, we would only warn about implicit
      RTEs in SELECTs with at least one explicit RTE.
      
      As a result of the warning change, 25 of the regression tests had to
      be updated. I also took the opportunity to remove some bogus whitespace
      differences between some of the float4 and float8 variants. I believe
      I have correctly updated all the platform-specific variants, but let
      me know if that's not the case.
      
      Original patch for DELETE ... USING from Euler Taveira de Oliveira,
      reworked by Neil Conway.
      f5ab0a14
  16. 26 Mar, 2005 1 commit
  17. 24 Mar, 2005 1 commit
    • 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
  18. 27 Oct, 2004 1 commit
  19. 11 Oct, 2004 1 commit
  20. 03 Oct, 2004 1 commit
  21. 21 Jul, 2004 3 commits
  22. 10 Jun, 2004 1 commit
    • Tom Lane's avatar
      Clean up generation of default names for constraints, indexes, and serial · 45616f5b
      Tom Lane authored
      sequences, as per recent discussion.  All these names are now of the
      form table_column_type, with digits added if needed to make them unique.
      Default constraint names are chosen to be unique across their whole schema,
      not just within the parent object, so as to be more SQL-spec-compatible
      and make the information schema views more useful.
      45616f5b
  23. 26 Apr, 2004 1 commit
  24. 01 Apr, 2004 1 commit
  25. 17 Mar, 2004 1 commit
    • Tom Lane's avatar
      Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END · 55f7c330
      Tom Lane authored
      so that the 'val' is computed only once, per recent discussion.  The
      speedup is not much when 'val' is just a simple variable, but could be
      significant for larger expressions.  More importantly this avoids issues
      with multiple evaluations of a volatile 'val', and it allows the CASE
      expression to be reverse-listed in its original form by ruleutils.c.
      55f7c330
  26. 09 Mar, 2004 1 commit
  27. 18 Dec, 2003 1 commit
  28. 03 Dec, 2003 1 commit
  29. 21 Nov, 2003 1 commit
    • Tom Lane's avatar
      COMMENT ON casts, conversions, languages, operator classes, and · 42ce74bf
      Tom Lane authored
      large objects.  Dump all these in pg_dump; also add code to pg_dump
      user-defined conversions.  Make psql's large object code rely on
      the backend for inserting/deleting LOB comments, instead of trying to
      hack pg_description directly.  Documentation and regression tests added.
      
      Christopher Kings-Lynne, code reviewed by Tom
      42ce74bf
  30. 31 Oct, 2003 1 commit
  31. 25 Sep, 2003 1 commit
  32. 27 Jul, 2003 1 commit
    • Bruce Momjian's avatar
      > Joe Conway <mail@joeconway.com> writes: · 38fb906f
      Bruce Momjian authored
      >>ISTM that "source" is worth knowing.
      >
      > Hm, possibly.  Any other opinions?
      
      This version has the seven fields I proposed, including "source". Here's
      an example that shows why I think it's valuable:
      
      regression=# \x
      Expanded display is on.
      regression=# select * from pg_settings where name = 'enable_seqscan';
      -[ RECORD 1 ]-----------
      name    | enable_seqscan
      setting | on
      context | user
      vartype | bool
      source  | default
      min_val |
      max_val |
      
      regression=# update pg_settings set setting = 'off' where name =
      'enable_seqscan';
      -[ RECORD 1 ]---
      set_config | off
      
      regression=# select * from pg_settings where name = 'enable_seqscan';
      -[ RECORD 1 ]-----------
      name    | enable_seqscan
      setting | off
      context | user
      vartype | bool
      source  | session
      min_val |
      max_val |
      
      regression=# alter user postgres set enable_seqscan to 'off';
      ALTER USER
      
      (log out and then back in again)
      
      regression=# \x
      Expanded display is on.
      regression=# select * from pg_settings where name = 'enable_seqscan';
      -[ RECORD 1 ]-----------
      name    | enable_seqscan
      setting | off
      context | user
      vartype | bool
      source  | user
      min_val |
      max_val |
      
      In the first case, enable_seqscan is set to its default value. After
      setting it to off, it is obvious that the value has been changed for the
      session only. In the third case, you can see that the value has been set
      specifically for the user.
      
      Joe Conway
      38fb906f
  33. 22 Jul, 2003 1 commit
  34. 21 Jul, 2003 1 commit
  35. 19 Jul, 2003 1 commit
  36. 26 May, 2003 1 commit
    • Tom Lane's avatar
      Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailing · f45df8c0
      Tom Lane authored
      blanks, in hopes of reducing the surprise factor for newbies.  Remove
      redundant operators for VARCHAR (it depends wholly on TEXT operations now).
      Clean up resolution of ambiguous operators/functions to avoid surprising
      choices for domains: domains are treated as equivalent to their base types
      and binary-coercibility is no longer considered a preference item when
      choosing among multiple operators/functions.  IsBinaryCoercible now correctly
      reflects the notion that you need *only* relabel the type to get from type
      A to type B: that is, a domain is binary-coercible to its base type, but
      not vice versa.  Various marginal cleanup, including merging the essentially
      duplicate resolution code in parse_func.c and parse_oper.c.  Improve opr_sanity
      regression test to understand about binary compatibility (using pg_cast),
      and fix a couple of small errors in the catalogs revealed thereby.
      Restructure "special operator" handling to fetch operators via index opclasses
      rather than hardwiring assumptions about names (cleans up the pattern_ops
      stuff a little).
      f45df8c0
  37. 23 Mar, 2003 1 commit
    • Tom Lane's avatar
      Instead of storing pg_statistic stavalues entries as text strings, store · 8d9e025e
      Tom Lane authored
      them as arrays of the internal datatype.  This requires treating the
      stavalues columns as 'anyarray' rather than 'text[]', which is not 100%
      kosher but seems to work fine for the purposes we need for pg_statistic.
      Perhaps in the future 'anyarray' will be allowed more generally.
      8d9e025e