summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2000-06-01Lexer defended us against overlength plain identifiers, but not againstTom Lane
overlength quoted identifiers. Death and destruction ensue...
2000-05-31The heralded `Grand Unified Configuration scheme' (GUC)Peter Eisentraut
That means you can now set your options in either or all of $PGDATA/configuration, some postmaster option (--enable-fsync=off), or set a SET command. The list of options is in backend/utils/misc/guc.c, documentation will be written post haste. pg_options is gone, so is that pq_geqo config file. Also removed were backend -K, -Q, and -T options (no longer applicable, although -d0 does the same as -Q). Added to configure an --enable-syslog option. changed all callers from TPRINTF to elog(DEBUG)
2000-05-30Third round of fmgr updates: eliminate calls using fmgr() andTom Lane
fmgr_faddr() in favor of new-style calls. Lots of cleanup of sloppy casts to use XXXGetDatum and DatumGetXXX ...
2000-05-30Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian
2000-05-29Generated header files parse.h and fmgroids.h are now copied intoTom Lane
the src/include tree, so that -I backend is no longer necessary anywhere. Also, clean up some bit rot in contrib tree.
2000-05-28First round of changes for new fmgr interface. fmgr itself and theTom Lane
key call sites are changed, but most called functions are still oldstyle. An exception is that the PL managers are updated (so, for example, NULL handling now behaves as expected in plperl and plpgsql functions). NOTE initdb is forced due to added column in pg_proc.
2000-05-27define YY_NEVER_INTERACTIVE for flex, to persuade flex that it's notTom Lane
necessary to call isatty() for each and every received query. That's one less kernel call per query cycle ...
2000-05-26Generate a reasonable error message when an aggregate function is appliedTom Lane
to an undecorated relation name (cf. example from Ed Loehr, 5/25/00).
2000-05-25Modify raw parsetree representation returned by gram.y for SubLinks:Tom Lane
the oper field should be a valid Node structure so it can be dumped by outfuncs.c without risk of coredump. (We had been using a raw pointer to character string, which surely is NOT a valid Node.) This doesn't cause any backwards compatibility problems for stored rules, since raw unanalyzed parsetrees are never stored.
2000-05-12Repair list-vs-node confusion that resulted in failure for INNER JOIN ON.Tom Lane
Make it behave correctly when there are more than two tables being joined, also. Update regression test expected outputs.
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-04-08Tweak TypeCategory to treat new BIT types as of STRING category, ratherTom Lane
than not knowing what they are at all. Perhaps they should have their own type category? Hard to say. In the meantime, doing it this way allows SELECT 'unknown' || 'unknown' to continue being resolved as textcat, instead of spitting out an ambiguous-operator error.
2000-04-07Add transcendental math functions (sine, cosine, etc)Thomas G. Lockhart
Add a random number generator and seed setter (random(), SET SEED) Fix up the interval*float8 math to carry partial months into the time field. Add float8*interval so we have symmetry in the available math. Fix the parser and define.c to accept SQL92 types as field arguments. Fix the parser to accept SQL92 types for CREATE TYPE, etc. This is necessary to allow... Bit/varbit support in contrib/bit cleaned up to compile and load cleanly. Still needs some work before final release. Implement the "SOME" keyword as a synonym for "ANY" per SQL92. Implement ascii(text), ichar(int4), repeat(text,int4) to help support the ODBC driver. Enable the TRUNCATE() function mapping in the ODBC driver.
2000-03-31New coding for SET provoked a 'var might be used uninitialized' warningTom Lane
from gcc. Which wasn't actually a code bug, but I don't like warnings.
2000-03-30Enable more flexible syntax for the SET command. Now allows single floats,Thomas G. Lockhart
single integers, and lists of names, without surrounding them with quotes. Remove all tokens which are defined as operators from ColID and ColLabel to avoid precedence confusion. Thanks to Tom Lane for catching this.
2000-03-27Allow full type names in CREATE FUNCTION arguments and return type.Thomas G. Lockhart
Move CREATE FUNCTION/WITH clause to end of statement to get around shift/reduce conflicts with type names containing "WITH". Add lots of tokens as allowed ColId's and/or ColLabel's, so this should be a complete set for the v7.0 release.
2000-03-24transformCreateStmt should put Ident nodes, not ColumnDef nodes, intoTom Lane
keys lists of Constraint nodes. This eliminates a type pun that would probably have caused trouble someday, and eliminates circular references in the parsetree that were causing trouble now. Also, change parser's uses of strcasecmp() to strcmp(). Since scan.l has downcased any unquoted identifier, it is never correct to check an identifier with strcasecmp() in the parser. For example, CREATE TABLE FOO (f1 int, UNIQUE("F1")); was accepted, which is wrong, and xlateSqlFunc did more than it should: select datetime(); ERROR: Function 'timestamp()' does not exist (good) select "DateTime"(); ERROR: Function 'timestamp()' does not exist (bad)
2000-03-23Remove no-longer-necessary restriction against uplevel correlation varsTom Lane
outside WHERE clause. Fix a couple of places that didn't handle uplevel refs cleanly.
2000-03-23Hack parse_coerce so it won't try to constant-fold the dummy ConstTom Lane
nodes introduced by make_subplan(). It'd be better if we used a different node type for subplan result placeholders, but for now...
2000-03-21Add syntax for BIT() and BIT VARYING(), but no underlying implementationThomas G. Lockhart
is available yet. Remove redundant call to xlateSqlType() in the character type handling code.
2000-03-20Reverse out BYTEA type coersion.Bruce Momjian
2000-03-20Emit 'this operator is deprecated' warnings for ':' and ';'.Tom Lane
2000-03-20Add compatiblity information for bytea.Bruce Momjian
2000-03-20Add FORCE keyword to ColIDHiroshi Inoue
2000-03-19transformExpr() did the Wrong Thing if applied to a SubLink node thatTom Lane
had already been transformed. This led to failure in examples like UPDATE table SET fld = (SELECT ...). Repair this, and revise the comments to explain that transformExpr has to be robust against this condition. Someday we might want to fix the callers so that transformExpr is never invoked on its own output, but that someday is not today.
2000-03-19Another go-round with resolution of ambiguous functions and operators.Tom Lane
In function parsing, try for an actual function of the given name and input types before trying to interpret the function call as a type coercion request, rather than after. Before, a function that had the same name as a type and operated on a binary-compatible type wouldn't get invoked. Also, cross-pollinate between func_select_candidates and oper_select_candidates to ensure that they use as nearly the same resolution rules as possible. A few other minor code cleanups too.
2000-03-19In can_coerce_type, verify that a possible type-coercion functionTom Lane
actually returns the type it is named for.
2000-03-18Improve error message wording in unary_op_error() --- suggest thatTom Lane
problem could be lack of parentheses. This addresses cases like X UserOp UserOp Y, which will be parsed as (X UserOp) UserOp Y, whereas what likely was wanted was X UserOp (UserOp Y).
2000-03-18Modify lexing of multi-char operators per pghackers discussion aroundTom Lane
16-Mar-00: trailing + or - is not part of the operator unless the operator also contains characters not present in SQL92-defined operators. This solves the 'X=-Y' problem without unduly constraining users' choice of operator names --- in particular, no existing Postgres operator names become invalid. Also, remove processing of // comments, as agreed in the same thread.
2000-03-18Just noticed that the grammar actually has no provision for '+' as aTom Lane
prefix operator :-(. Bad enough that we have no implementation of unary plus, but at least with this fix the grammar will take it.
2000-03-18Add translation of timespan to interval.Bruce Momjian
2000-03-17Add safety check on expression nesting depth. Default value is set byTom Lane
a config.h #define, and the runtime value can be controlled via SET.
2000-03-17Fix a bunch of minor portability problems and maybe-bugs revealed byTom Lane
running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
2000-03-16Turns out that Mazurkiewicz's gripe about 'function inheritance' isTom Lane
actually a type-coercion problem. If you have a function defined on class A, and class B inherits from A, then the function ought to work on class B as well --- but coerce_type didn't know that. Now it does.
2000-03-15Tweak GROUP BY so that it will still accept result-column names, but onlyTom Lane
after trying to resolve the item as an input-column name. This allows us to be compliant with the SQL92 spec for queries that fall within the spec, while still accepting the same out-of-spec queries as 6.5 did. You'll only lose if there is an output column name that is the same as an input column name, but doesn't refer to the same value. 7.0 will interpret such a GROUP BY spec differently than 6.5 did. No way around that, because 6.5 was clearly not spec compliant.
2000-03-15Add 'datetime' -> 'timestamp' conversion to xlateSqlFunc() to easeTom Lane
the pain of updating apps to 7.0. Should we also translate some of the 'datetime_foo' functions that exist in 6.* ?
2000-03-14Implement column aliases on views "CREATE VIEW name (collist)".Thomas G. Lockhart
Implement TIME WITH TIME ZONE type (timetz internal type). Remap length() for character strings to CHAR_LENGTH() for SQL92 and to remove the ambiguity with geometric length() functions. Keep length() for character strings for backward compatibility. Shrink stored views by removing internal column name list from visible rte. Implement min(), max() for time and timetz data types. Implement conversion of TIME to INTERVAL. Implement abs(), mod(), fac() for the int8 data type. Rename some math functions to generic names: round(), sqrt(), cbrt(), pow(), etc. Rename NUMERIC power() function to pow(). Fix int2 factorial to calculate result in int4. Enhance the Oracle compatibility function translate() to work with string arguments (from Edwin Ramirez). Modify pg_proc system table to remove OID holes.
2000-03-13Performance improvement for lexing long strings: increase flex'sTom Lane
YY_READ_BUF_SIZE, which turns out to have nothing to do with buffer size. It's just a totally arbitrary upper limit on how much data myinput() is asked for at one time.
2000-03-12Somehow, the variant NATIONAL CHAR [ VARYING ] was missing from theTom Lane
set of SQL-standard type names that we accept.
2000-03-12Clean up grammar's handling of NULL in expressions: a_expr_or_null isTom Lane
gone, replaced by plain a_expr. The few places where we needed to distinguish NULL from a_expr are now handled by tests inside the actions rather than by separate productions. This allows us to accept queries like 'SELECT 1 + NULL' without requiring parentheses around the NULL.
2000-03-11Make TypeCategory think that NAME is a member of typeTom Lane
category STRING. Also, if UNKNOWNOID is passed in, return UNKNOWN_TYPE not USER_TYPE.
2000-03-11Further fixes for bogus list-slinging, scribbling on input, etc in typeTom Lane
coercion code. I'm beginning to wonder why we have separate candidate selection routines for functions, operators, and aggregates --- shouldn't this code all be unified? But meanwhile, SELECT 'a' LIKE 'a'; finally works; the code for dealing with unknown input types for operators was pretty busted.
2000-03-11Finish cleaning up backend's handling of /* ... */ and -- comments,Tom Lane
per pghackers discussion around 20-Feb. Also add specific error messages for unterminated comments and unterminated quoted strings. These things are nonissues for input coming from psql, but they do matter for input coming from other front ends.
2000-03-09Trial implementation of ALTER DROP COLUMN.Hiroshi Inoue
They are #ifdef'd. Add -D_DROP_COLUMN_HACK__ compile option to evaluate it.
2000-03-07Someone (probably me) forgot about handling of typecasts applied toTom Lane
parameters.
2000-03-01Simplify parsing of column constraints by treating constraint attributesTom Lane
as independent clauses in the grammar. analyze.c takes care of putting the data where it belongs and complaining about invalid combinations. Also, make TEMP (and TEMPORARY) non-reserved words.
2000-02-29Changed execution time of ON <event> RESTRICT referentialJan Wieck
integrity triggers to after statement allways. Ignores deferred state now, closer to SQL3 semantics. Jan
2000-02-27Add lztext to TypeCategory so that lztext OP text cases will workTom Lane
correctly (the lztext value will be promoted to text automatically).
2000-02-27Fix poorly worded error messages for unary operator type resolutionTom Lane
failures. Fix some outright bugs too, including a reference to uninitialized memory that would cause failures like this one: select -('1234567890.1234567'::text); ERROR: Unable to locate type oid 2139062143 in catalog
2000-02-26Fix exprTypmod to recognize length-coercion function expressions,Tom Lane
such as bpchar(char_expression, N), and pull out the attrtypmod that the function is coercing to. This allows correct deduction of the column type in examples such as CREATE VIEW v AS SELECT f1::char(8) FROM tbl; Formerly we labeled v's column as char-of-unknown-length not char(8). Also, this change causes the parser not to insert a redundant length coercion function if the user has explicitly casted an INSERT or UPDATE expression to the right length.