summaryrefslogtreecommitdiff
path: root/src/backend/nodes/readfuncs.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Hi!Bruce Momjian1999-01-181-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for the CASE statement in the rewrite handling.Thomas G. Lockhart1998-12-141-1/+49
| | | | | | Allows (at least some) rules and views. Still some trouble (crashes) with target CASE columns spanning tables, but lots now works.
* Fix using indices in OR.Vadim B. Mikheev1998-11-221-1/+4
| | | | EXPLAIN all indices used.
* Add LIMIT syntax for Jan.Bruce Momjian1998-10-221-1/+7
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-011-7/+7
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-011-65/+65
|
* MergeSort was sometimes called mergejoin and was confusing. NowBruce Momjian1998-08-041-9/+9
| | | | it is now only mergejoin.
* Allow index use with OR clauses.Bruce Momjian1998-08-011-4/+4
|
* Rename Rel to RelOptInfo.Bruce Momjian1998-07-181-6/+6
|
* Fix explain for union and inheritance. Rename Append structureBruce Momjian1998-07-151-10/+10
| | | | members to be clearer. Fix cost computation for these.
* Major man page update from Tom Lane. cBruce Momjian1998-07-141-2/+2
|
* Remove un-needed braces around single statements.Bruce Momjian1998-06-151-143/+1
|
* FIx confusion over SORT and SORTCLAUSE in node handling.Bruce Momjian1998-04-271-48/+47
|
* pgindent run before 6.3 release, with Thomas' requested changes.Bruce Momjian1998-02-261-31/+31
|
* Add handling for new RangeTblEntry column name.Bruce Momjian1998-02-211-5/+13
|
* Constlen can be -1, so make it a signed type.Bruce Momjian1998-02-211-2/+2
|
* Support for subselects.Vadim B. Mikheev1998-02-131-1/+5
| | | | (Have to re-visit readfuncs.c)
* Pass around typmod as int16.Bruce Momjian1998-02-101-2/+2
|
* Pass attypmod through to executor by adding to Var and Resdom.Bruce Momjian1998-02-101-4/+8
|
* Add Var.varlevelup to code. More parser cleanup.Bruce Momjian1998-01-201-1/+5
|
* Parser cleanup.Bruce Momjian1998-01-201-2/+2
| | | | Add lock to i386 asm.
* Fix problem with nodes handling.Bruce Momjian1998-01-191-2/+2
|
* Creates the SubLink structure, and the Query->hasSubLink field,Bruce Momjian1998-01-171-1/+44
| | | | | | | | with supporting code. Creates SubLink node in gram.y. psql.c patch for newatttypmod field.
* Remove Query->qry_aggs and qry_numaggs and replace with Query->hasAggs.Bruce Momjian1998-01-151-18/+6
| | | | | | | | | Pass List* of Aggregs into executor, and create needed array there. No longer need to double-processs Aggregs with second copy in Query. Fix crash when doing: select sum(x+1) from test where 1 > 0;
* Goodbye ABORT. Hello ERROR for all errors.Bruce Momjian1998-01-071-4/+4
|
* Fix for views and outnodes.Bruce Momjian1998-01-071-3/+1
|
* Cleanup of sort nodes and use of strtoul .Bruce Momjian1998-01-061-51/+53
|
* Change some labels in bootparse to make ctags happy. Clean up ↵Bruce Momjian1998-01-061-62/+142
| | | | outfunc/readfunc code and add missing fields for Query structure and new Union fields. Fix optimizer bug shown in new \do command. Change WARN to ERROR in contrib and regression stuff.
* Change elog(WARN) to elog(ERROR) and elog(ABORT).Bruce Momjian1998-01-051-4/+4
|
* UNION work for UNION ALL and other union stuff.Bruce Momjian1997-12-271-1/+2
|
* Remove Existential, and ifdef out generate_fjoin. Neither did anything.Bruce Momjian1997-12-181-23/+1
|
* Rename strNcpy to StrNCpy, and change third parameter.Bruce Momjian1997-10-251-4/+4
|
* Used modified version of indent that understands over 100 typedefs.Bruce Momjian1997-09-081-6/+6
|
* Another PGINDENT run that changes variable indenting and case label ↵Bruce Momjian1997-09-081-168/+168
| | | | indenting. Also static variable indenting.
* Massive commit to run PGINDENT on all *.c and *.h files.Bruce Momjian1997-09-071-1528/+1671
|
* Fix pgproc names over 15 chars in output. Add strNcpy() function. remove ↵Bruce Momjian1997-08-121-7/+4
| | | | some (void) casts that are unnecessary.
* Added _readAggreg() to work with T_Aggreg type.Vadim B. Mikheev1997-05-121-1/+42
|
* All external function definitions now have prototypes that are checked.Bruce Momjian1996-11-101-2/+2
|
* Compile and warning cleanupBruce Momjian1996-11-081-5/+5
|
* Fixes:Marc G. Fournier1996-07-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | In postgres95/src/backend/nodes/readfuncs, lines 1188 and 1189, local_node->relname is taken to point to a NameType, while its defined as a pointer to char. Both the casting to Name and the call of namestrcpy should, IMHO, be changed appropriately (first patch). As far as I could see from the Linux signal header file, a signal handler is declared as typedef void (*__sighandler_t)(int); Few changes to postgres95/src/backend/storage/lmgr/proc.c seem appropriate to comply with this. Finally, postgres95/src/bin/pg_version/pg_version.c defines a function GetDataHome (by default, returning an integer) and returns NULL in the function, which isn't an integer... Submitted by: ernst.molitor@uni-bonn.de
* Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01Marc G. Fournier1996-07-091-0/+1948