summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2003-10-02Change some notices to warnings and vice versa according to criteriaPeter Eisentraut
developed on -hackers.
2003-10-02Remove NOTICE about foreign key creating implicit triggers, because it noPeter Eisentraut
longer conveys useful information.
2003-09-29More message editing, some suggested by Alvaro HerreraPeter Eisentraut
2003-09-26Various message fixes, among those fixes for the previous round of fixesPeter Eisentraut
2003-09-25Fix grammatical error introduced into error message.Tom Lane
2003-09-25Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut
terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
2003-09-23Tweak generic_type_consistency routines to avoid loss of functionalityTom Lane
since 7.3: 'select array_dims(histogram_bounds) from pg_stats' used to work and still should. Problem was that code wouldn't take input of declared type anyarray as matching an anyarray argument. Allow this case as long as we don't need to determine an element type (which in practice means as long as anyelement isn't used in the function signature).
2003-09-15Improve a couple of error messages per suggestions from Alvaro Herrera.Tom Lane
2003-09-09Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut
feature they complain about isn't a feature or cannot be implemented without definitional changes.
2003-09-06Make all valid uses of the COLLATE clause yield the same result: a syntaxPeter Eisentraut
error. There is no point in providing some kind of forward compatibility now, because no one can tell what a future implementation will look like.
2003-08-22Tweak grammar to use FastAppend rather than lappend when constructingTom Lane
expr_lists. This appears to be the only remaining O(N^2) bottleneck in processing many-way 'x IN (a,b,c,...)' conditions.
2003-08-17Fix ARRAY[] construct so that in multidimensional case, elements canTom Lane
be anything yielding an array of the proper kind, not only sub-ARRAY[] constructs; do subscript checking at runtime not parse time. Also, adjust array_cat to make array || array comply with the SQL99 spec. Joe Conway
2003-08-17Create a 'type cache' that keeps track of the data needed for any particularTom Lane
datatype by array_eq and array_cmp; use this to solve problems with memory leaks in array indexing support. The parser's equality_oper and ordering_oper routines also use the cache. Change the operator search algorithms to look for appropriate btree or hash index opclasses, instead of assuming operators named '<' or '=' have the right semantics. (ORDER BY ASC/DESC now also look at opclasses, instead of assuming '<' and '>' are the right things.) Add several more index opclasses so that there is no regression in functionality for base datatypes. initdb forced due to catalog additions.
2003-08-11Rewriter and planner should use only resno, not resname, to identifyTom Lane
target columns in INSERT and UPDATE targetlists. Don't rely on resname to be accurate in ruleutils, either. This fixes bug reported by Donald Fraser, in which renaming a column referenced in a rule did not work very well.
2003-08-11Code cleanup inspired by recent resname bug report (doesn't fix the bugTom Lane
yet, though). Avoid using nth() to fetch tlist entries; provide a common routine get_tle_by_resno() to search a tlist for a particular resno. This replaces a couple uses of nth() and a dozen hand-coded search loops. Also, replace a few uses of nth(length-1, list) with llast().
2003-08-08Another pgindent run with updated typedefs.Bruce Momjian
2003-08-07create_unique_plan() should not discard existing output columns of theTom Lane
subplan it starts with, as they may be needed at upper join levels. See comments added to code for the non-obvious reason why. Per bug report from Robert Creager.
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-08-04pgindent run.Bruce Momjian
2003-08-01Adjust 'permission denied' messages to be more useful and consistent.Tom Lane
2003-07-28A visit from the message-style police ...Tom Lane
2003-07-20Another round of error message editing, covering backend/commands/.Tom Lane
2003-07-19Another round of error message editing, covering backend/parser/.Tom Lane
2003-07-18First bits of work on error message editing.Tom Lane
2003-07-16Add defenses against trying to attach qual conditions to a setOperationTom Lane
query node, since that won't work unless the planner is upgraded. Someday we should try to support at least some cases of this, but for now just plug the hole in the dike. Per discussion with Dmitry Tkach.
2003-07-04Some early work on error message editing. Operator-not-found andTom Lane
function-not-found messages now distinguish the cases no-match and ambiguous-match, and they follow the style guidelines too.
2003-07-03Do honest transformation and preprocessing of LIMIT/OFFSET clauses,Tom Lane
instead of the former kluge whereby gram.y emitted already-transformed expressions. This is needed so that Params appearing in these clauses actually work correctly. I suppose some might claim that the side effect of 'SELECT ... LIMIT 2+2' working is a new feature, but I say this is a bug fix.
2003-07-03Code review for UPDATE tab SET col = DEFAULT patch ... whack it aroundTom Lane
so it has some chance of working in rules ...
2003-07-01Aggregates can be polymorphic, using polymorphic implementation functions.Tom Lane
It also works to create a non-polymorphic aggregate from polymorphic functions, should you want to do that. Regression test added, docs still lacking. By Joe Conway, with some kibitzing from Tom Lane.
2003-07-01Change EXECUTE INTO to CREATE TABLE AS EXECUTE.Peter Eisentraut
2003-06-29Support expressions of the form 'scalar op ANY (array)' andTom Lane
'scalar op ALL (array)', where the operator is applied between the lefthand scalar and each element of the array. The operator must yield boolean; the result of the construct is the OR or AND of the per-element results, respectively. Original coding by Joe Conway, after an idea of Peter's. Rewritten by Tom to keep the implementation strictly separate from subqueries.
2003-06-27Fix compile warnings.Tom Lane
2003-06-27First batch of object rename commands.Peter Eisentraut
2003-06-27Create real array comparison functions (that use the element datatype'sTom Lane
comparison functions), replacing the highly bogus bitwise array_eq. Create a btree index opclass for ANYARRAY --- it is now possible to create indexes on array columns. Arrange to cache the results of catalog lookups across multiple array operations, instead of repeating the lookups on every call. Add string_to_array and array_to_string functions. Remove singleton_array, array_accum, array_assign, and array_subscript functions, since these were for proof-of-concept and not intended to become supported functions. Minor adjustments to behavior in some corner cases with empty or zero-dimensional arrays. Joe Conway (with some editorializing by Tom Lane).
2003-06-25Back out array mega-patch.Bruce Momjian
Joe Conway
2003-06-25Don't generate 'zero' typeids in the output from gen_cross_product.Tom Lane
This is no longer necessary or appropriate since we don't use zero typeid as a wildcard anymore, and it fixes a nasty performance problem with functions with many parameters. Per recent example from Reuven Lerner.
2003-06-25 Fix up JOIN .. USING with domainsBruce Momjian
The attached fixes select_common_type() to support the below case: create table t1( c1 int); create domain dom_c1 int; create table t2(c1 dom_c1); select * from t1 join t2 using( c1 ); I didn't see a need for maintaining the domain as the preferred type. A simple getBaseType() call on all elements of the list seems to be enough. -- Rod Taylor <rbt@rbt.ca>
2003-06-25UPDATE ... SET <col> = DEFAULTBruce Momjian
Rod Taylor
2003-06-25Includes:Bruce Momjian
- LIKE <subtable> [ INCLUDING DEFAULTS | EXCLUDING DEFAULTS ] - Quick cleanup of analyze.c function prototypes. - New non-reserved keywords (INCLUDING, EXCLUDING, DEFAULTS), SQL 200X Opted not to extend for check constraints at this time. As per the definition that it's user defined columns, OIDs are NOT inherited. Doc and Source patches attached. -- Rod Taylor <rbt@rbt.ca>
2003-06-24Array mega-patch.Bruce Momjian
Joe Conway
2003-06-19Disallow dollar sign in operator names, instead allow it as a non-firstTom Lane
character in identifiers. The first change eliminates the current need to put spaces around parameter references, as in "x<=$2". The second change improves compatibility with Oracle and some other RDBMSes. This was discussed and agreed to back in January, but did not get done.
2003-06-17Make FLOAT(p) measure the precision p in bits, not decimal digits, toTom Lane
match the SQL standard. Document FLOAT and FLOAT(p) notations in datatype.sgml. Per recent pghackers discussion.
2003-06-16Allow GROUP BY, ORDER BY, DISTINCT targets to be unknown literals,Tom Lane
silently resolving them to type TEXT. This is comparable to what we do when faced with UNKNOWN in CASE, UNION, and other contexts. It gets rid of this and related annoyances: select distinct f1, '' from int4_tbl; ERROR: Unable to identify an ordering operator '<' for type unknown This was discussed many moons ago, but no one got round to fixing it.
2003-06-15Replace cryptic 'Unknown kind of return type' messages with somethingTom Lane
hopefully a little more useful.
2003-06-15Cause GROUP BY clause to adopt ordering operators from ORDER BY whenTom Lane
both clauses specify the same targets, rather than always using the default ordering operator. This allows 'GROUP BY foo ORDER BY foo DESC' to be done with only one sort step.
2003-06-11Add add_missing_from GUC variable.Bruce Momjian
Nigel J. Andrews
2003-06-06Implement outer-level aggregates to conform to the SQL spec, withTom Lane
extensions to support our historical behavior. An aggregate belongs to the closest query level of any of the variables in its argument, or the current query level if there are no variables (e.g., COUNT(*)). The implementation involves adding an agglevelsup field to Aggref, and treating outer aggregates like outer variables at planning time.
2003-05-31markTargetListOrigin neglected to handle outer-scope Vars properly;Tom Lane
per report from Joe Conway.
2003-05-29Ensure that in all flex lexers that are part of the backend, aTom Lane
yy_fatal_error() call results in elog(ERROR) not exit(). This was already fixed in the main lexer and plpgsql, but extend same technique to all the other dot-l files. Also, on review of the possible calls to yy_fatal_error(), it seems safe to use elog(ERROR) not elog(FATAL).
2003-05-29Adopt latest bison's spelling of 'syntax error' rather than 'parse error'Tom Lane
for grammar-detected problems. Revert Makefile hack that kept it looking like the pre-bison-1.875 output.