1. 23 Sep, 1999 1 commit
  2. 17 Jul, 1999 1 commit
  3. 15 Jul, 1999 1 commit
  4. 13 Jul, 1999 1 commit
  5. 12 May, 1999 1 commit
    • Thomas G. Lockhart's avatar
      Add keywords to implement Vadim's transaction isolation · bcb5aac8
      Thomas G. Lockhart authored
       and lock syntax as fully parsed tokens.
      Two keywords for isolation are non-reserved SQL92
       (COMMITTED, SERIALIZABLE).
      All other new keywords are non-reserved Postgres (not SQL92)
       (ACCESS, EXCLUSIVE, MODE, SHARE).
      Add syntax to allow CREATE [GLOBAL|LOCAL] TEMPORARY TABLE, throwing an
       error if GLOBAL is specified.
      bcb5aac8
  6. 19 Apr, 1999 1 commit
  7. 07 Mar, 1999 1 commit
  8. 13 Feb, 1999 1 commit
  9. 08 Feb, 1999 1 commit
  10. 02 Feb, 1999 1 commit
  11. 18 Jan, 1999 1 commit
    • Bruce Momjian's avatar
      Hi! · bd8ffc6f
      Bruce Momjian authored
      INTERSECT and EXCEPT is available for postgresql-v6.4!
      
      The patch against v6.4 is included at the end of the current text
      (in uuencoded form!)
      
      I also included the text of my Master's Thesis. (a postscript
      version). I hope that you find something of it useful and would be
      happy if parts of it find their way into the PostgreSQL documentation
      project (If so, tell me, then I send the sources of the document!)
      
      The contents of the document are:
        -) The first chapter might be of less interest as it gives only an
           overview on SQL.
      
        -) The second chapter gives a description on much of PostgreSQL's
           features (like user defined types etc. and how to use these features)
      
        -) The third chapter starts with an overview of PostgreSQL's internal
           structure with focus on the stages a query has to pass (i.e. parser,
           planner/optimizer, executor). Then a detailed description of the
           implementation of the Having clause and the Intersect/Except logic is
           given.
      
      Originally I worked on v6.3.2 but never found time enough to prepare
      and post a patch. Now I applied the changes to v6.4 to get Intersect
      and Except working with the new version. Chapter 3 of my documentation
      deals with the changes against v6.3.2, so keep that in mind when
      comparing the parts of the code printed there with the patched sources
      of v6.4.
      
      Here are some remarks on the patch. There are some things that have
      still to be done but at the moment I don't have time to do them
      myself. (I'm doing my military service at the moment) Sorry for that
      :-(
      
      -) I used a rewrite technique for the implementation of the Except/Intersect
         logic which rewrites the query to a semantically equivalent query before
         it is handed to the rewrite system (for views, rules etc.), planner,
         executor etc.
      
      -) In v6.3.2 the types of the attributes of two select statements
         connected by the UNION keyword had to match 100%. In v6.4 the types
         only need to be familiar (i.e. int and float can be mixed). Since this
         feature did not exist when I worked on Intersect/Except it
         does not work correctly for Except/Intersect queries WHEN USED IN
         COMBINATION WITH UNIONS! (i.e. sometimes the wrong type is used for the
         resulting table. This is because until now the types of the attributes of
         the first select statement have been used for the resulting table.
         When Intersects and/or Excepts are used in combination with Unions it
         might happen, that the first select statement of the original query
         appears at another position in the query which will be executed. The reason
         for this is the technique used for the implementation of
         Except/Intersect which does a query rewrite!)
         NOTE: It is NOT broken for pure UNION queries and pure INTERSECT/EXCEPT
               queries!!!
      
      -) I had to add the field intersect_clause to some data structures
         but did not find time to implement printfuncs for the new field.
         This does NOT break the debug modes but when an Except/Intersect
         is used the query debug output will be the already rewritten query.
      
      -) Massive changes to the grammar rules for SELECT and INSERT statements
         have been necessary (see comments in gram.y and documentation for
         deatails) in order to be able to use mixed queries like
         (SELECT ... UNION (SELECT ... EXCEPT SELECT)) INTERSECT SELECT...;
      
      -) When using UNION/EXCEPT/INTERSECT you will get:
         NOTICE: equal: "Don't know if nodes of type xxx are equal".
         I did not have  time to add comparsion support for all the needed nodes,
         but the default behaviour of the function equal met my requirements.
         I did not dare to supress this message!
      
         That's the reason why the regression test for union will fail: These
         messages are also included in the union.out file!
      
      -) Somebody of you changed the union_planner() function for v6.4
         (I copied the targetlist to new_tlist and that was removed and
         replaced by a cleanup of the original targetlist). These chnages
         violated some having queries executed against views so I changed
         it back again. I did not have time to examine the differences between the
         two versions but now it works :-)
         If you want to find out, try the file queries/view_having.sql on
         both versions and compare the results . Two queries won't produce a
         correct result with your version.
      
      regards
      
          Stefan
      bd8ffc6f
  12. 18 Dec, 1998 1 commit
  13. 04 Dec, 1998 1 commit
  14. 18 Oct, 1998 2 commits
  15. 30 Sep, 1998 1 commit
  16. 13 Sep, 1998 1 commit
  17. 01 Sep, 1998 2 commits
  18. 25 Aug, 1998 2 commits
  19. 24 Aug, 1998 2 commits
    • Bruce Momjian's avatar
      OLD has to return CURRENT for now, Jan. · 8876ae2c
      Bruce Momjian authored
      8876ae2c
    • Bruce Momjian's avatar
      This is the final state of the rule system for 6.4 after the · 15cb32d9
      Bruce Momjian authored
          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
  20. 24 Jul, 1998 1 commit
    • Marc G. Fournier's avatar
      · bf00bbb0
      Marc G. Fournier authored
      I really hope that I haven't missed anything in this one...
      
      From: t-ishii@sra.co.jp
      
      Attached are patches to enhance the multi-byte support.  (patches are
      against 7/18 snapshot)
      
      * determine encoding at initdb/createdb rather than compile time
      
      Now initdb/createdb has an option to specify the encoding. Also, I
      modified the syntax of CREATE DATABASE to accept encoding option. See
      README.mb for more details.
      
      For this purpose I have added new column "encoding" to pg_database.
      Also pg_attribute and pg_class are changed to catch up the
      modification to pg_database.  Actually I haved added pg_database_mb.h,
      pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
      enabled. The reason having separate files is I couldn't find a way to
      use ifdef or whatever in those files. I have to admit it looks
      ugly. No way.
      
      * support for PGCLIENTENCODING when issuing COPY command
      
      commands/copy.c modified.
      
      * support for SQL92 syntax "SET NAMES"
      
      See gram.y.
      
      * support for LATIN2-5
      * add UNICODE regression test case
      * new test suite for MB
      
      New directory test/mb added.
      
      * clean up source files
      
      Basic idea is to have MB's own subdirectory for easier maintenance.
      These are include/mb and backend/utils/mb.
      bf00bbb0
  21. 09 May, 1998 1 commit
  22. 18 Mar, 1998 1 commit
    • Thomas G. Lockhart's avatar
      Allow parsing expressions with ") -" (scan.l, scan.c only). · 561aead3
      Thomas G. Lockhart authored
      Make "TABLE" optional in "LOCK TABLE" command
       and "... INTO TABLE..." clause.
      Explicitly parse CREATE SEQUENCE options to allow a negative integer
       as an argument; this is an artifact of unary minus handling in scan.l.
      Add "PASSWORD" as an allowed column identifier.
      These fixes will require a "make clean install" but not a dump/reload.
      561aead3
  23. 11 Feb, 1998 1 commit
    • Thomas G. Lockhart's avatar
      Define ROW and STATEMENT as parser tokens. · 878b8d64
      Thomas G. Lockhart authored
      Use explicit tokens to decode CREATE TRIGGER clauses.
      Allow ROW and STATEMENT as column identifiers.
      Fix CAST syntax to require parens per SQL92 spec.
      Define TypeId to allow correct translation of type names in CREATE FUNCTION
       and other statements. Need to do this without looking up defined type
       names because CREATE FUNCTION can specify undefined (new) types.
      Define UserId to complete removal of "Id" generic entity.
      Define xlateSqlFunc() to convert SQL92 CHARACTER_LENGTH() and CHAR_LENGTH()
       functions to calls to length().
      Define func_name parser entity for contexts requiring a function name.
      Have xlateSqlType() translate "float" to "float8".
      878b8d64
  24. 04 Feb, 1998 1 commit
  25. 03 Feb, 1998 1 commit
  26. 22 Jan, 1998 1 commit
  27. 20 Jan, 1998 1 commit
  28. 19 Jan, 1998 1 commit
  29. 05 Jan, 1998 1 commit
  30. 16 Dec, 1997 1 commit
  31. 04 Dec, 1997 1 commit
  32. 26 Nov, 1997 1 commit
  33. 25 Nov, 1997 1 commit
  34. 24 Nov, 1997 1 commit
  35. 21 Nov, 1997 1 commit
  36. 07 Nov, 1997 1 commit
    • Thomas G. Lockhart's avatar
      Implement CREATE DATABASE/WITH LOCATION=. · acc28430
      Thomas G. Lockhart authored
      Implement SET keyword = DEFAULT and SET TIME ZONE DEFAULT.
      Re-enable JOIN= option in CREATE OPERATOR statement (damaged for v6.2).
      Allow more SQL and/or Postgres reserved words as column identifiers
       or, if there are shift/reduce problems, at least as column labels.
      acc28430