1. 01 10月, 1999 1 次提交
    • T
      Clean up rewriter routines to use expression_tree_walker and · 389af07c
      Tom Lane 提交于
      expression_tree_mutator rather than ad-hoc tree walking code.  This shortens
      the code materially and fixes a fair number of sins of omission.  Also,
      change modifyAggrefQual to *not* recurse into subselects, since its mission
      is satisfied if it removes aggregate functions from the top level of a
      WHERE clause.  This cures problems with queries of the form SELECT ...
      WHERE x IN (SELECT ... HAVING something-using-an-aggregate), which would
      formerly get mucked up by modifyAggrefQual.  The routine is still
      fundamentally broken, of course, but I don't think there's any way to get
      rid of it before we implement subselects in FROM ...
      389af07c
  2. 19 9月, 1999 1 次提交
    • T
      Mega-commit to make heap_open/heap_openr/heap_close take an · bd272cac
      Tom Lane 提交于
      additional argument specifying the kind of lock to acquire/release (or
      'NoLock' to do no lock processing).  Ensure that all relations are locked
      with some appropriate lock level before being examined --- this ensures
      that relevant shared-inval messages have been processed and should prevent
      problems caused by concurrent VACUUM.  Fix several bugs having to do with
      mismatched increment/decrement of relation ref count and mismatched
      heap_open/close (which amounts to the same thing).  A bogus ref count on
      a relation doesn't matter much *unless* a SI Inval message happens to
      arrive at the wrong time, which is probably why we got away with this
      sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
      DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
      Recommend 'make clean all' after pulling this update; I modified the
      Relation struct layout slightly.
      Will post further discussion to pghackers list shortly.
      bd272cac
  3. 16 7月, 1999 3 次提交
  4. 15 7月, 1999 1 次提交
  5. 14 2月, 1999 1 次提交
  6. 26 1月, 1999 1 次提交
  7. 24 1月, 1999 1 次提交
  8. 03 10月, 1998 1 次提交
    • B
      Here's a combination of all the patches I'm currently waiting · f93b6974
      Bruce Momjian 提交于
          for against a just updated CVS tree. It contains
      
              Partial new rewrite system that handles subselects,  view
              aggregate  columns, insert into select from view, updates
              with set col = view-value and select rules restriction to
              view definition.
      
              Updates  for  rule/view  backparsing utility functions to
              handle subselects correct.
      
      
              New system views pg_tables and pg_indexes (where you  can
              see the complete index definition in the latter one).
      
              Enabling array references on query parameters.
      
              Bugfix for functional index.
      
              Little changes to system views pg_rules and pg_views.
      
      
          The rule system isn't a release-stopper any longer.
      
          But  another  stopper  is  that  I  don't  know if the latest
          changes to PL/pgSQL (not already in CVS) made it  compile  on
          AIX. Still wait for some response from Dave.
      
      Jan
      f93b6974
  9. 01 9月, 1998 2 次提交
  10. 24 8月, 1998 1 次提交
    • B
      This is the final state of the rule system for 6.4 after the · 15cb32d9
      Bruce Momjian 提交于
          patch is applied:
      
      	Rewrite rules on relation level work fine now.
      
      	Event qualifications on insert/update/delete  rules  work
      	fine now.
      
      	I  added  the  new  keyword  OLD to reference the CURRENT
      	tuple. CURRENT will be removed in 6.5.
      
      	Update rules can  reference  NEW  and  OLD  in  the  rule
      	qualification and the actions.
      
      	Insert/update/delete rules on views can be established to
      	let them behave like real tables.
      
      	For  insert/update/delete  rules  multiple  actions   are
      	supported  now.   The  actions  can also be surrounded by
      	parantheses to make psql  happy.   Multiple  actions  are
      	required if update to a view requires updates to multiple
      	tables.
      
      	Regular users  are  permitted  to  create/drop  rules  on
      	tables     they     have     RULE     permissions     for
      	(DefineQueryRewrite() is  now  able  to  get  around  the
      	access  restrictions  on  pg_rewrite).  This enables view
      	creation for regular users too. This  required  an  extra
      	boolean  parameter  to  pg_parse_and_plan() that tells to
      	set skipAcl on all rangetable entries  of  the  resulting
      	queries.       There      is      a      new     function
      	pg_exec_query_acl_override()  that  could  be   used   by
      	backend utilities to use this facility.
      
      	All rule actions (not only views) inherit the permissions
      	of the event relations  owner.  Sample:  User  A  creates
      	tables    T1    and    T2,   creates   rules   that   log
      	INSERT/UPDATE/DELETE on T1 in T2 (like in the  regression
      	tests  for rules I created) and grants ALL but RULE on T1
      	to user B.  User B  can  now  fully  access  T1  and  the
      	logging  happens  in  T2.  But user B cannot access T2 at
      	all, only the rule actions can. And due to  missing  RULE
      	permissions on T1, user B cannot disable logging.
      
      	Rules  on  the  attribute  level are disabled (they don't
      	work properly and since regular users are  now  permitted
      	to create rules I decided to disable them).
      
      	Rules  on  select  must have exactly one action that is a
      	select (so select rules must be a view definition).
      
      	UPDATE NEW/OLD rules  are  disabled  (still  broken,  but
      	triggers can do it).
      
      	There are two new system views (pg_rule and pg_view) that
      	show the definition of the rules or views so the db admin
      	can  see  what  the  users do. They use two new functions
      	pg_get_ruledef() and pg_get_viewdef() that are  builtins.
      
      	The functions pg_get_ruledef() and pg_get_viewdef() could
      	be used to implement rule and view support in pg_dump.
      
      	PostgreSQL is now the only database system I  know,  that
      	has rewrite rules on the query level. All others (where I
      	found a  rule  statement  at  all)  use  stored  database
      	procedures  or  the  like  (triggers as we call them) for
      	active rules (as some call them).
      
          Future of the rule system:
      
      	The now disabled parts  of  the  rule  system  (attribute
      	level,  multiple  actions on select and update new stuff)
      	require a complete new rewrite handler from scratch.  The
      	old one is too badly wired up.
      
      	After  6.4  I'll  start to work on a new rewrite handler,
      	that fully supports the attribute level  rules,  multiple
      	actions on select and update new.  This will be available
      	for 6.5 so we get full rewrite rule capabilities.
      
      Jan
      15cb32d9
  11. 16 6月, 1998 1 次提交
  12. 26 2月, 1998 1 次提交
  13. 21 1月, 1998 1 次提交
  14. 16 1月, 1998 1 次提交
  15. 04 1月, 1998 1 次提交
  16. 09 9月, 1997 1 次提交
  17. 08 9月, 1997 1 次提交
  18. 07 9月, 1997 1 次提交
  19. 10 11月, 1996 1 次提交
  20. 09 7月, 1996 1 次提交