summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
1999-08-23Remove bogus code in oper_exact --- if it didn't find an exactTom Lane
match then it tried for a self-commutative operator with the reversed input data types. This is pretty silly; there could never be such an operator, except maybe in binary-compatible-type scenarios, and we have oper_inexact for that. Besides which, the oprsanity regress test would complain about such an operator. Remove nonfunctional code and simplify routine calling convention accordingly.
1999-08-22Further planner/optimizer cleanups. Move all set_tlist_referencesTom Lane
and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
1999-08-21Major revision of sort-node handling: push knowledge of queryTom Lane
sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb.
1999-08-18Old multi-byte bug. Forgot to rename #ifdef MB to #ifdef MULTIBYTETatsuo Ishii
Now SET NAMES working again...
1999-08-16Small updates to #include lists for pending optimizer checkin.Tom Lane
1999-08-16Move funcid_get_rettype() to lsyscache.Tom Lane
1999-08-15Repair the check for redundant UNIQUE and PRIMARY KEY indices.Thomas G. Lockhart
Also, improve it so that it checks for multi-column constraints. Thanks to Mark Dalphin <mdalphin@amgen.com> for reporting the problem.
1999-08-05Revise parse_coerce() to handle coercion of int and floatTom Lane
constants, not only string constants, at parse time. Get rid of parser_typecast2(), which is bogus and redundant...
1999-07-28Allow a_expr not just AexprConst in the right-hand list ofTom Lane
IN and NOT IN operators. Rewrite grotty implementation of IN-list parsing ... look Ma, no global variable ...
1999-07-27First cut at doing LIKE/regex indexing optimization inTom Lane
optimizer rather than parser. This has many advantages, such as not getting fooled by chance uses of operator names ~ and ~~ (the operators are identified by OID now), and not creating useless comparison operations in contexts where the comparisons will not actually be used as indexquals. The new code also recognizes exact-match LIKE and regex patterns, and produces an = indexqual instead of >= and <=. This change does NOT fix the problem with non-ASCII locales: the code still doesn't know how to generate an upper bound indexqual for non-ASCII collation order. But it's no worse than before, just the same deficiency in a different place... Also, dike out loc_restrictinfo fields in Plan nodes. These were doing nothing useful in the absence of 'expensive functions' optimization, and they took a considerable amount of processing to fill in.
1999-07-20Complain about INSERT ... SELECT ... ORDER BY, which we do notTom Lane
support, but which the grammar was accepting. Also, fix several bugs having to do with failure to copy fields up from a subselect to a select or insert node.
1999-07-19Rewrite parser's handling of INSERT ... SELECT so that processingTom Lane
of the SELECT part of the statement is just like a plain SELECT. All INSERT-specific processing happens after the SELECT parsing is done. This eliminates many problems, e.g. INSERT ... SELECT ... GROUP BY using the wrong column labels. Ensure that DEFAULT clauses are coerced to the target column type, whether or not stored clause produces the right type. Substantial cleanup of parser's array support.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-17Add config.h as needed.Bruce Momjian
1999-07-16Support subscripts on bare column names.Tom Lane
1999-07-16Allow bare column names to be subscripted as arrays. ThisTom Lane
creates a reduce/reduce conflict, which I resolved by changing the 'AexprConst -> Typename Sconst' rule to 'AexprConst -> SimpleTypename Sconst'. In other words, a subscripted type declaration can't be used in that syntax any longer. This seems a small price to pay for not having to qualify subscripted columns anymore. Other cleanups: rename res_target_list to update_target_list, and remove productions for variants that are not legal in an UPDATE target list; rename res_target_list2 to plain target_list; delete position_expr in favor of using b_expr in that production; merge opt_indirection into attr nonterminal, since there are no places where an unsubscripted attr is wanted; fix typos in Param support; change case_arg so that an arbitrary a_expr is allowed, not only a column name.
1999-07-16Final cleanup.Bruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-07-15Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian
1999-07-13Remove S*I comments from Stephan.Bruce Momjian
1999-07-11Ignore resjunk targetlist entries when matching arguments toTom Lane
a SubLink with the subplan's targetlist. This fixes a problem seen with, for example, a subselect that uses GROUP BY.
1999-07-09Make ^ precidence greater than *.Bruce Momjian
1999-07-08Add ^ precidence.Bruce Momjian
1999-07-04Clarify maximum tuple and max attribute lengths.Bruce Momjian
1999-07-03Fix to prevent too large tuple from being created.Bruce Momjian
1999-06-21On second thought, expression_tree_walker should handle bareTom Lane
SubLink nodes after all ...
1999-06-19My first chosen victim for expression_tree_walker conversionTom Lane
is parse_aggs.c. This fixes its failure to cope with (at least) CaseExpr and ArrayRef nodes, which is the reason why both of these fail in 6.5: select coalesce(f1,0) from int4_tbl group by f1; ERROR: Illegal use of aggregates or non-group column in target list select sentence.words[0] from sentence group by sentence.words[0]; ERROR: Illegal use of aggregates or non-group column in target list The array case still fails, but at least it's not parse_agg's fault anymore ... considering that we now support CASE officially, I think it's important to fix the first example ...
1999-06-17Defend against function calls with more than 8 arguments (codeTom Lane
used to overrun its fixed-size arrays before detecting error; not cool). Also, replace uses of magic constant '8' with 'MAXFARGS'.
1999-06-07Repair recently-introduced error in makeIndexable for LIKE:Tom Lane
a non-leading % would be put into the >=/<= patterns. Also, repair longstanding confusion about whether %% means a literal %%. The SQL92 doesn't say any such thing, and textlike() knows that, but gram.y didn't.
1999-06-05Instead of failing when the constructed name for a sequence,Tom Lane
index, etc is too long, truncate until it fits.
1999-05-29Avoid redundant SysCache searches in coerce_type, for anotherTom Lane
few percent speedup in INSERT...
1999-05-26Make functions static or NOT_USED as appropriate.Bruce Momjian
1999-05-25Make 0x007f -> (unsigned)0x7f to make pgindent happy.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-05-23Do not assign output columns to junk attributes created fromTom Lane
GROUP BY or ORDER BY expressions in INSERT ... SELECT.
1999-05-23Detect case of invalid use of GROUP BY when there are noTom Lane
aggregate functions, as in select a, b from foo group by a; The ungrouped reference to b is not kosher, but formerly we neglected to check this unless there was an aggregate function somewhere in the query.
1999-05-22Fix for select 1;select 2 without trailing semi.Bruce Momjian
1999-05-22Fix for DEFAULT ''.Bruce Momjian
1999-05-22Make postgres prompt backend>, and remove PARSEDEBUG.Bruce Momjian
1999-05-21Fix typo and attempt default fix.Bruce Momjian
1999-05-21Treat {} as special regex too.Bruce Momjian
1999-05-21Fix problem with | in ~ comparison using index.Bruce Momjian
1999-05-20Fixed shift/reduce conflictJan Wieck
SelectStmt and CursorStmt tried to parse FOR UPDATE ... / FOR READ ONLY. Cursor now checks that it is read only by looking at forUpdate of Query. SelectStmt handles FOR READ ONLY too. Jan
1999-05-19Remove 4096 string limited key on block sizeBruce Momjian
1999-05-19Upgrade to PyGreSQL (2.4)Bruce Momjian
1999-05-18Add Aggref and ArrayRef to the set of node types that transformExprTom Lane
will pass through rather than spitting up. This is necessary to handle cases where coerce_type causes a subexpression to be retransformed, as in SELECT count(*) + 1.0 FROM table
1999-05-17Skip junk nodes when comparing UNION target list lengths.Bruce Momjian
1999-05-17Change resjunk to a boolean.Bruce Momjian
1999-05-17Prior patch added 2 more characters to string allocatedTom Lane
for SERIAL column's constraint, but forgot to increase space palloc'd...
1999-05-17SELECT * error message fix.Bruce Momjian