summaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Trivial refactoring: move analysis of ViewStmt into its own function forNeil Conway2004-01-051-46/+56
| | | | readability and for the sake of consistency with the rest of analyze.c
* Reorder tests in parse_coerce so that ANY/ANYELEMENT/ANYARRAY coercionTom Lane2003-12-171-20/+20
| | | | | | does not affect UNKNOWN-type literals or Params. This fixes the recent complaint about count('x') being broken, and improves consistency in a few other respects too.
* This patch adds a new GUC var, "default_with_oids", which follows theBruce Momjian2003-12-011-2/+8
| | | | | | | | proposal for eventually deprecating OIDs on user tables that I posted earlier to pgsql-hackers. pg_dump now always specifies WITH OIDS or WITHOUT OIDS when dumping a table. The documentation has been updated. Neil Conway
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-2917-17/+17
|
* Overdue code review for ALTER SEQUENCE patch. Don't generate illegal NodeTom Lane2003-11-241-3/+3
| | | | | | tree for CYCLE option; don't assume zeros are invalid values for sequence fields other than increment_by; don't reset cache_value when not told to; simplify code for testing whether to apply defaults.
* COMMENT ON casts, conversions, languages, operator classes, andTom Lane2003-11-212-9/+54
| | | | | | | | | large objects. Dump all these in pg_dump; also add code to pg_dump user-defined conversions. Make psql's large object code rely on the backend for inserting/deleting LOB comments, instead of trying to hack pg_description directly. Documentation and regression tests added. Christopher Kings-Lynne, code reviewed by Tom
* Cross-data-type comparisons are now indexable by btrees, pursuant to myTom Lane2003-11-121-5/+5
| | | | | | | | | | pghackers proposal of 8-Nov. All the existing cross-type comparison operators (int2/int4/int8 and float4/float8) have appropriate support. The original proposal of storing the right-hand-side datatype as part of the primary key for pg_amop and pg_amproc got modified a bit in the event; it is easier to store zero as the 'default' case and only store a nonzero when the operator is actually cross-type. Along the way, remove the long-since-defunct bigbox_ops operator class.
* Add operator strategy and comparison-value datatype fields to ScanKey.Tom Lane2003-11-091-4/+5
| | | | | | | | | | | Remove the 'strategy map' code, which was a large amount of mechanism that no longer had any use except reverse-mapping from procedure OID to strategy number. Passing the strategy number to the index AM in the first place is simpler and faster. This is a preliminary step in planned support for cross-datatype index operations. I'm committing it now since the ScanKeyEntryInitialize() API change touches quite a lot of files, and I want to commit those changes before the tree drifts under me.
* Implement isolation levels read uncommitted and repeatable read as actingPeter Eisentraut2003-11-062-6/+12
| | | | like the next higher one.
* Fix for this problem:Tom Lane2003-11-051-21/+57
| | | | | | | | | | | regression=# select 1 from tenk1 ta cross join tenk1 tb for update; ERROR: no relation entry for relid 3 7.3 said "SELECT FOR UPDATE cannot be applied to a join", which was better but still wrong, considering that 7.2 took the query just fine. Fix by making transformForUpdate() ignore JOIN and other special RTE types, rather than trying to mark them FOR UPDATE. The actual error message now only appears if you explicitly name the join in FOR UPDATE.
* Improve error reporting in parseTypeString(), motivated by confusingTom Lane2003-10-201-6/+28
| | | | behavior reported by Martin Marques.
* Make sure that -- comments extend to the end of the line. This fixes thePeter Eisentraut2003-10-091-14/+14
| | | | | | | | misscanning of this construct: SELECT ''hello world'' -- SELECT ''goodbye world'' ::text;
* Fix binary_oper_exact() so that the heuristic 'an unknown literal onTom Lane2003-10-061-7/+31
| | | | | | one side of a binary operator is probably supposed to be the same type as the other operand' will be applied for domain types. This worked in 7.3 but was broken in 7.4 due to code rearrangements. Mea culpa.
* Change some notices to warnings and vice versa according to criteriaPeter Eisentraut2003-10-021-10/+10
| | | | developed on -hackers.
* Remove NOTICE about foreign key creating implicit triggers, because it noPeter Eisentraut2003-10-021-5/+1
| | | | longer conveys useful information.
* More message editing, some suggested by Alvaro HerreraPeter Eisentraut2003-09-292-4/+4
|
* Various message fixes, among those fixes for the previous round of fixesPeter Eisentraut2003-09-264-12/+12
|
* Fix grammatical error introduced into error message.Tom Lane2003-09-251-2/+2
|
* Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut2003-09-2511-97/+100
| | | | | terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
* Tweak generic_type_consistency routines to avoid loss of functionalityTom Lane2003-09-231-9/+34
| | | | | | | | 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).
* Improve a couple of error messages per suggestions from Alvaro Herrera.Tom Lane2003-09-151-2/+3
|
* Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut2003-09-091-2/+2
| | | | | feature they complain about isn't a feature or cannot be implemented without definitional changes.
* Make all valid uses of the COLLATE clause yield the same result: a syntaxPeter Eisentraut2003-09-061-30/+4
| | | | | 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.
* Tweak grammar to use FastAppend rather than lappend when constructingTom Lane2003-08-221-3/+14
| | | | | expr_lists. This appears to be the only remaining O(N^2) bottleneck in processing many-way 'x IN (a,b,c,...)' conditions.
* Fix ARRAY[] construct so that in multidimensional case, elements canTom Lane2003-08-171-39/+4
| | | | | | | | 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
* Create a 'type cache' that keeps track of the data needed for any particularTom Lane2003-08-173-103/+196
| | | | | | | | | | | 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.
* Rewriter and planner should use only resno, not resname, to identifyTom Lane2003-08-113-21/+21
| | | | | | | 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.
* Code cleanup inspired by recent resname bug report (doesn't fix the bugTom Lane2003-08-112-97/+109
| | | | | | | | 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().
* Another pgindent run with updated typedefs.Bruce Momjian2003-08-081-11/+10
|
* create_unique_plan() should not discard existing output columns of theTom Lane2003-08-071-5/+2
| | | | | | 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.
* Update copyrights to 2003.Bruce Momjian2003-08-0416-32/+32
|
* pgindent run.Bruce Momjian2003-08-0411-483/+525
|
* Adjust 'permission denied' messages to be more useful and consistent.Tom Lane2003-08-011-2/+3
|
* A visit from the message-style police ...Tom Lane2003-07-286-24/+24
|
* Another round of error message editing, covering backend/commands/.Tom Lane2003-07-203-18/+30
|
* Another round of error message editing, covering backend/parser/.Tom Lane2003-07-1911-560/+989
|
* First bits of work on error message editing.Tom Lane2003-07-186-82/+148
|
* Add defenses against trying to attach qual conditions to a setOperationTom Lane2003-07-161-1/+17
| | | | | | 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.
* Some early work on error message editing. Operator-not-found andTom Lane2003-07-042-155/+166
| | | | | function-not-found messages now distinguish the cases no-match and ambiguous-match, and they follow the style guidelines too.
* Do honest transformation and preprocessing of LIMIT/OFFSET clauses,Tom Lane2003-07-034-80/+127
| | | | | | | | 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.
* Code review for UPDATE tab SET col = DEFAULT patch ... whack it aroundTom Lane2003-07-033-35/+33
| | | | so it has some chance of working in rules ...
* Aggregates can be polymorphic, using polymorphic implementation functions.Tom Lane2003-07-012-27/+167
| | | | | | 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.
* Change EXECUTE INTO to CREATE TABLE AS EXECUTE.Peter Eisentraut2003-07-011-4/+16
|
* Support expressions of the form 'scalar op ANY (array)' andTom Lane2003-06-293-3/+132
| | | | | | | | | | '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.
* Fix compile warnings.Tom Lane2003-06-272-2/+4
|
* First batch of object rename commands.Peter Eisentraut2003-06-273-49/+123
|
* Create real array comparison functions (that use the element datatype'sTom Lane2003-06-273-35/+101
| | | | | | | | | | | | | | | | 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).
* Back out array mega-patch.Bruce Momjian2003-06-255-154/+12
| | | | Joe Conway
* Don't generate 'zero' typeids in the output from gen_cross_product.Tom Lane2003-06-251-49/+76
| | | | | | 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.
* Fix up JOIN .. USING with domainsBruce Momjian2003-06-251-3/+3
| | | | | | | | | | | | | | | | 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>