aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
* Print error on SELECT tab FROM tab:Bruce Momjian2001-05-21
| | | | You can't use relation names alone in the target list, try relation.*
* Comment additions in parser.Bruce Momjian2001-05-19
|
* Move ParserFuncOrColumn function higher in the file.Bruce Momjian2001-05-19
|
* New comment. This func/column things has always confused me.Bruce Momjian2001-05-19
| | | | | | | | | | | | | | | | | | | /* * parse function * This code is confusing because the database can accept * relation.column, column.function, or relation.column.function. * In these cases, funcname is the last parameter, and fargs are * the rest. * * It can also be called as func(col) or func(col,col). * In this case, Funcname is the part before parens, and fargs * are the part in parens. * */ Node * ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, bool agg_star, bool agg_distinct, int precedence)
* Undo \dT change. Not worth it.Bruce Momjian2001-05-18
|
* Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian2001-05-18
|
* Small code cleanups,formatting.Bruce Momjian2001-05-18
|
* Remove unused tables pg_variable, pg_inheritproc, pg_ipl tables. InitdbBruce Momjian2001-05-14
| | | | forced.
* This patch should catch cases where the typesBruce Momjian2001-05-09
| | | | | | | | in referencing and referenced columns of an fk constraint aren't comparable using '=' at constraint definition time rather than insert/update time. Stephan Szabo
* Use ColId instead of Ident for SET SESSION AUTHORIZATION.Peter Eisentraut2001-05-09
|
* Add SET SESSION AUTHORIZATION command.Peter Eisentraut2001-05-08
|
* Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane2001-05-07
| | | | | | | | | | | | | | | | | a separate statement (though it can still be invoked as part of VACUUM, too). pg_statistic redesigned to be more flexible about what statistics are stored. ANALYZE now collects a list of several of the most common values, not just one, plus a histogram (not just the min and max values). Random sampling is used to make the process reasonably fast even on very large tables. The number of values and histogram bins collected is now user-settable via an ALTER TABLE command. There is more still to do; the new stats are not being used everywhere they could be in the planner. But the remaining changes for this project should be localized, and the behavior is already better than before. A not-very-related change is that sorting now makes use of btree comparison routines if it can find one, rather than invoking '<' twice.
* Makefile should have automatic dependency for parser.o too, if it'sTom Lane2001-05-04
| | | | going to have any at all.
* Allow a string argument to the EXTRACT() function.Thomas G. Lockhart2001-05-01
| | | | | | | This is an extension to the SQL9x standard, but is consistant with usage of the underlying date_part() function used to implement it. Example: EXTRACT('YEAR',...) No impact on regression tests.
* compatible_oper needs to do ReleaseSysCache in one path to avoidTom Lane2001-04-23
| | | | complaints about 'Cache reference leak'. Per report from Don Baccus.
* Further tweaking of error messages for cases involving attributes &Tom Lane2001-04-18
| | | | | | functions of join or subselect aliases. It'd be awfully nice if this code knew for sure whether it was dealing with 'x.f' or 'f(x)' syntax; maybe we can fix that in a future cycle.
* Make rule lister do the right thing with Vars representing whole tuples.Tom Lane2001-04-18
|
* Fix Joubert's complaint that int8-sized numeric literals are mishandledTom Lane2001-03-22
| | | | | | | | | on Alpha (because parser mistakenly assumes that a nonoverflow result from strtol means the value will fit into int4). A scan for other uses of strtol and strtoul found a couple other places with the same mistake; fix them too. The changes are all conditional on HAVE_LONG_INT_64 to avoid complaints from compilers that think x != x is a silly test (cf. pg_atoi).
* Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian2001-03-22
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Give a more reasonable error message for a bad attribute name appliedTom Lane2001-03-14
| | | | to a join or subselect alias ... cf. Oliver Elphick's complaint 13-Mar.
* Fix vacuum analyze error.Tatsuo Ishii2001-02-27
| | | | | | | | | | | | | | | | | | vacuum analyze on pg_type fails if bogus entries remain in pg_operator. Here is a sample script to reproduce the problem. drop table t1; create table t1(i int); drop function foo(t1,t1); create function foo(t1,t1) returns bool as 'select true' language 'sql'; create operator = ( leftarg = t1, rightarg = t1, commutator = =, procedure = foo ); drop table t1; vacuum analyze;
* Change case-folding of keywords to conform to SQL99 and fix misbehaviorTom Lane2001-02-21
| | | | | | | in Turkish locale. Keywords are now checked under pure ASCII case-folding rules ('A'-'Z'->'a'-'z' and nothing else). However, once a word is determined not to be a keyword, it will be case-folded under the current locale, same as before. See pghackers discussion 20-Feb-01.
* Allow extract() to accept the same field selectors as date_part(), not justPeter Eisentraut2001-02-18
| | | | the ones specified by SQL.
* Clean up two rather nasty bugs in operator selection code.Tom Lane2001-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. If there is exactly one pg_operator entry of the right name and oprkind, oper() and related routines would return that entry whether its input type had anything to do with the request or not. This is just premature optimization: we shouldn't return the single candidate until after we verify that it really is a valid candidate, ie, is at least coercion-compatible with the given types. 2. oper() and related routines only promise a coercion-compatible result. Unfortunately, there were quite a few callers that assumed the returned operator is binary-compatible with the given datatype; they would proceed to call it without making any datatype coercions. These callers include sorting, grouping, aggregation, and VACUUM ANALYZE. In general I think it is appropriate for these callers to require an exact or binary-compatible match, so I've added a new routine compatible_oper() that only succeeds if it can find an operator that doesn't require any run-time conversions. Callers now call oper() or compatible_oper() depending on whether they are prepared to deal with type conversion or not. The upshot of these bugs is revealed by the following silliness in PL/Tcl's selftest: it creates an operator @< on int4, and then tries to use it to sort a char(N) column. The system would let it do that :-( (and evidently has done so since 6.3 :-( :-(). The result in this case was just a silly sort order, but the reverse combination would've provoked coredump from trying to dereference integers. With this fix you get more reasonable behavior: pltcl_test=# select * from T_pkey1 order by key1, key2 using @<; ERROR: Unable to identify an operator '@<' for types 'bpchar' and 'bpchar' You will have to retype this query using an explicit cast
* Arrange for ORDER BY an expression on a UNION/INTERSECT/EXCEPT result,Tom Lane2001-02-15
| | | | | | | | | | such as SELECT f1 FROM foo UNION SELECT ... ORDER BY upper(f1) to draw 'ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of the result columns' rather than the uninformative 'f1 not found' we were producing before. Eventually this should actually work, but that looks much too hard to try to implement in late beta...
* Repair problems with duplicate index names generated when CREATE TABLETom Lane2001-02-14
| | | | specifies redundant UNIQUE conditions.
* Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane2001-02-14
| | | | | | | | | clause with an alias is a <subquery> and therefore hides table references appearing within it, according to the spec. This is the same as the preliminary patch I posted to pgsql-patches yesterday, plus some really grotty code in ruleutils.c to reverse-list a query tree with the correct alias name depending on context. I'd rather not have done that, but unless we want to force another initdb for 7.1, there's no other way for now.
* Only look for bison as YACC; other yaccs need to be selected explicitly.Peter Eisentraut2001-02-10
| | | | | When no suitable YACC is configured, supply useful informational messages to users. (Same way flex has been handled for a while.)
* plpgsql's private copy of xlateSqlType was out of sync. Again. ThisTom Lane2001-02-09
| | | | | is clearly not maintainable, so dike it out in favor of calling the real version in the backend's gram.y.
* Use elog() instead of exit() for fatal scanner errors.Peter Eisentraut2001-02-03
|
* Fix failure to create sequences for more than one SERIAL column in aTom Lane2001-01-27
| | | | table.
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Give 'a_expr ::= a_expr Op' production a slightly lower precedence thanTom Lane2001-01-23
| | | | | | | | | | Op, so that the sequence 'a_expr Op Op a_expr' will be parsed as a_expr Op (Op a_expr) not (a_expr Op) Op a_expr as formerly. In other words, prefer treating user-defined operators as prefix operators to treating them as postfix operators, when there is an ambiguity. Also clean up a couple of other infelicities in production priority assignment --- for example, BETWEEN wasn't being given the intended priority, but that of AND.
* Remove no-longer-needed restriction against referencing systemTom Lane2001-01-23
| | | | | | attributes in a FieldSelect node --- all the places that manipulate these work just fine with system attribute numbers. OK, it's a new feature, so shoot me ...
* Give a good error message for what's likely to be a common syntax error,Tom Lane2001-01-20
| | | | namely omitting the alias clause for a sub-SELECT in FROM.
* Suppress unused-variable warning in non-Assert compilations.Tom Lane2001-01-19
|
* Change lcons(x, NIL) to makeList(x) where appropriate.Bruce Momjian2001-01-17
|
* Fix problems with parentheses around sub-SELECT --- for the last time,Tom Lane2001-01-15
| | | | | | | | | | | | | I hope. I finally realized that we were going at it backwards: when there are excess parentheses, they need to be treated as part of the sub-SELECT, not as part of the surrounding expression. Although either choice yields an unambiguous grammar, only this way produces a grammar that is LALR(1). With the old approach we were guaranteed to fail on either 'SELECT (((SELECT 2)) + 3)' or 'SELECT (((SELECT 2)) UNION SELECT 2)' depending on which way we resolve the initial shift/reduce conflict. With the new way, the same reduction track can be followed in both cases until we have advanced far enough to know whether we are done with the sub-SELECT or not.
* Remove compiler warning about uninitialized warnings.Bruce Momjian2001-01-08
|
* Simplify the rules that explicitly allowed TYPE as a type name (which isPeter Eisentraut2001-01-06
| | | | | no longer the case). Add AND and TRAILING to ColLabel. All key words except AS are now at least ColLabel's.
* Remove not-really-standard implementation of CREATE TABLE's UNDER clause,Tom Lane2001-01-05
| | | | | | | | | | | and revert documentation to describe the existing INHERITS clause instead, per recent discussion in pghackers. Also fix implementation of SQL_inheritance SET variable: it is not cool to look at this var during the initial parsing phase, only during parse_analyze(). See recent bug report concerning misinterpretation of date constants just after a SET TIMEZONE command. gram.y really has to be an invariant transformation of the query string to a raw parsetree; anything that can vary with time must be done during parse analysis.
* Fix portability problems recently exposed by regression tests on Alphas.Tom Lane2000-12-27
| | | | | | | | | | 1. Distinguish cases where a Datum representing a tuple datatype is an OID from cases where it is a pointer to TupleTableSlot, and make sure we use the right typlen in each case. 2. Make fetchatt() and related code support 8-byte by-value datatypes on machines where Datum is 8 bytes. Centralize knowledge of the available by-value datatype sizes in two macros in tupmacs.h, so that this will be easier if we ever have to do it again.
* Clean up CREATE TYPE/OPERATOR/AGGREGATE productions, so that parserTom Lane2000-12-22
| | | | will not accept types named with operator names or vice versa.
* Repair mishandling of PRIMARY KEY declaration that references anTom Lane2000-12-18
| | | | inherited column, per bug report from Elphick 12/15/00.
* Tweak select_common_type() to deal with possibility of multiple preferredTom Lane2000-12-17
| | | | | types in a category --- it was taking the last preferred type among the inputs, rather than the first one as intended.
* Remove current->old mapping.Bruce Momjian2000-12-15
|
* Make algorithm for resolving UNKNOWN function/operator inputs beTom Lane2000-12-15
| | | | insensitive to the order of arguments. Per pghackers discussion 12/10/00.
* Remove obsolete comment.Tom Lane2000-12-15
|
* transformForUpdate() mustn't assume rowMarks list is initially empty.Tom Lane2000-12-07
| | | | | It could be recursing into a sub-query where there was already a FOR UPDATE clause.