summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2001-07-04Prohibit a column from appearing twice in a PRIMARY KEY or UNIQUETom Lane
constraint. This case (a) is useless, (b) violates SQL92, and (c) is certain to cause a failure downstream when we try to create an index with duplicated column names. So give an appropriate error message instead of letting the index failure occur. Per report from Colin Strickland. NOTE: currently, CREATE INDEX fooi ON foo(f1,f1) still fails with 'cannot insert duplicate key' error. Should we change that too? What about functional indexes?
2001-06-30Allow default transaction isolation level (a.k.a. set sessionPeter Eisentraut
characteristics) to be set through GUC.
2001-06-25Optimizer can now estimate selectivity of IS NULL, IS NOT NULL,Tom Lane
IS TRUE, etc, with some degree of verisimilitude. Split out selectivity support functions from builtins.h into a new header file selfuncs.h, so as to reduce the number of header files builtins.h must depend on. Fix a few missing inclusions exposed thereby. From Joe Conway, with some kibitzing from Tom Lane.
2001-06-24Back out BYTEA binary compatibility changes.Bruce Momjian
2001-06-23> Marko Kreen <marko@l-t.ee> writes:Bruce Momjian
> > secure_ctx changes too. it will be PGC_BACKEND after '-p'. > > Oh, okay, I missed that part. Could we see the total state of the > patch --- ie, a diff against current CVS, not a bunch of deltas? > I've gotten confused about what's in and what's out. Ok, here it is. Cleared the ctx comment too - after -p it will be PGC_BACKEND in any case. Marko Kreen
2001-06-23Add TEMPORARY sequences and have SERIAL on a temp table have a temporaryBruce Momjian
sequence.
2001-06-22Statistical system views (yet without the config stuff, butJan Wieck
it's hard to keep such massive changes in sync with the tree so I need to get it in and work from there now). Jan
2001-06-19Add IS UNKNOWN, IS NOT UNKNOWN boolean tests, fix the existing booleanTom Lane
tests to return the correct results per SQL9x when given NULL inputs. Reimplement these tests as well as IS [NOT] NULL to have their own expression node types, instead of depending on special functions. From Joe Conway, with a little help from Tom Lane.
2001-06-09Allow GRANT/REVOKE to/from more than one user per invocation. Command tagPeter Eisentraut
for GRANT/REVOKE is now just that, not "CHANGE". On the way, migrate some of the aclitem internal representation away from the parser and build a real parse tree instead. Also add some 'const' qualifiers.
2001-06-07reset all: command line and .conf options change defaultsBruce Momjian
on RESET ALL those are restored. show all: GUC + non-GUC. SHOW ALL, RESET ALL Marko Kreen
2001-06-04This patch adds support for %TYPE in CREATE FUNCTION argument and returnBruce Momjian
types. This version has an elog() to remind the user the type resolution is not dynamic. Ian Lance Taylor
2001-06-04Give error message, rather than coredump, for utility statements inTom Lane
conditional rules (rules with WHERE clauses). We cannot support these since there's noplace to hang a condition on a utility statement. We caught the other case (attempt to attach a condition at rewrite time) awhile ago, but this one escaped notice until now.
2001-05-27Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut
privileges. INSERT and COPY FROM now require INSERT (only). Add privileges regression test.
2001-05-22Make bit and bit varying types reject too long input. (They already triedPeter Eisentraut
to do that, but inconsistently.) Make bit type reject too short input, too, per SQL. Since it no longer zero pads, 'zpbit*' has been renamed to 'bit*' in the source, hence initdb.
2001-05-21Print error on SELECT tab FROM tab:Bruce Momjian
You can't use relation names alone in the target list, try relation.*
2001-05-19Comment additions in parser.Bruce Momjian
2001-05-19Move ParserFuncOrColumn function higher in the file.Bruce Momjian
2001-05-19New comment. This func/column things has always confused me.Bruce Momjian
/* * 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)
2001-05-18Undo \dT change. Not worth it.Bruce Momjian
2001-05-18Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian
2001-05-18Small code cleanups,formatting.Bruce Momjian
2001-05-14Remove unused tables pg_variable, pg_inheritproc, pg_ipl tables. InitdbBruce Momjian
forced.
2001-05-09 This patch should catch cases where the typesBruce Momjian
in referencing and referenced columns of an fk constraint aren't comparable using '=' at constraint definition time rather than insert/update time. Stephan Szabo
2001-05-09Use ColId instead of Ident for SET SESSION AUTHORIZATION.Peter Eisentraut
2001-05-08Add SET SESSION AUTHORIZATION command.Peter Eisentraut
2001-05-07Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane
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.
2001-05-04Makefile should have automatic dependency for parser.o too, if it'sTom Lane
going to have any at all.
2001-05-01Allow a string argument to the EXTRACT() function.Thomas G. Lockhart
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.
2001-04-23compatible_oper needs to do ReleaseSysCache in one path to avoidTom Lane
complaints about 'Cache reference leak'. Per report from Don Baccus.
2001-04-18Further tweaking of error messages for cases involving attributes &Tom Lane
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.
2001-04-18Make rule lister do the right thing with Vars representing whole tuples.Tom Lane
2001-03-22Fix Joubert's complaint that int8-sized numeric literals are mishandledTom Lane
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).
2001-03-22Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-03-14Give a more reasonable error message for a bad attribute name appliedTom Lane
to a join or subselect alias ... cf. Oliver Elphick's complaint 13-Mar.
2001-02-27Fix vacuum analyze error.Tatsuo Ishii
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;
2001-02-21Change case-folding of keywords to conform to SQL99 and fix misbehaviorTom Lane
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.
2001-02-18Allow extract() to accept the same field selectors as date_part(), not justPeter Eisentraut
the ones specified by SQL.
2001-02-16Clean up two rather nasty bugs in operator selection code.Tom Lane
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
2001-02-15Arrange for ORDER BY an expression on a UNION/INTERSECT/EXCEPT result,Tom Lane
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...
2001-02-14Repair problems with duplicate index names generated when CREATE TABLETom Lane
specifies redundant UNIQUE conditions.
2001-02-14Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane
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.
2001-02-10Only look for bison as YACC; other yaccs need to be selected explicitly.Peter Eisentraut
When no suitable YACC is configured, supply useful informational messages to users. (Same way flex has been handled for a while.)
2001-02-09plpgsql's private copy of xlateSqlType was out of sync. Again. ThisTom Lane
is clearly not maintainable, so dike it out in favor of calling the real version in the backend's gram.y.
2001-02-03Use elog() instead of exit() for fatal scanner errors.Peter Eisentraut
2001-01-27Fix failure to create sequences for more than one SERIAL column in aTom Lane
table.
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-23Give 'a_expr ::= a_expr Op' production a slightly lower precedence thanTom Lane
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.
2001-01-23Remove no-longer-needed restriction against referencing systemTom Lane
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 ...
2001-01-20Give a good error message for what's likely to be a common syntax error,Tom Lane
namely omitting the alias clause for a sub-SELECT in FROM.