aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
...
* Turns out that Mazurkiewicz's gripe about 'function inheritance' isTom Lane2000-03-16
| | | | | | 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.
* Tweak GROUP BY so that it will still accept result-column names, but onlyTom Lane2000-03-15
| | | | | | | | | | 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.
* Add 'datetime' -> 'timestamp' conversion to xlateSqlFunc() to easeTom Lane2000-03-15
| | | | | the pain of updating apps to 7.0. Should we also translate some of the 'datetime_foo' functions that exist in 6.* ?
* Implement column aliases on views "CREATE VIEW name (collist)".Thomas G. Lockhart2000-03-14
| | | | | | | | | | | | | | | | | | 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.
* Performance improvement for lexing long strings: increase flex'sTom Lane2000-03-13
| | | | | | 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.
* Somehow, the variant NATIONAL CHAR [ VARYING ] was missing from theTom Lane2000-03-12
| | | | set of SQL-standard type names that we accept.
* Clean up grammar's handling of NULL in expressions: a_expr_or_null isTom Lane2000-03-12
| | | | | | | 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.
* Make TypeCategory think that NAME is a member of typeTom Lane2000-03-11
| | | | | category STRING. Also, if UNKNOWNOID is passed in, return UNKNOWN_TYPE not USER_TYPE.
* Further fixes for bogus list-slinging, scribbling on input, etc in typeTom Lane2000-03-11
| | | | | | | | | 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.
* Finish cleaning up backend's handling of /* ... */ and -- comments,Tom Lane2000-03-11
| | | | | | | 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.
* Trial implementation of ALTER DROP COLUMN.Hiroshi Inoue2000-03-09
| | | | | | They are #ifdef'd. Add -D_DROP_COLUMN_HACK__ compile option to evaluate it.
* Someone (probably me) forgot about handling of typecasts applied toTom Lane2000-03-07
| | | | parameters.
* Simplify parsing of column constraints by treating constraint attributesTom Lane2000-03-01
| | | | | | 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.
* Changed execution time of ON <event> RESTRICT referentialJan Wieck2000-02-29
| | | | | | | integrity triggers to after statement allways. Ignores deferred state now, closer to SQL3 semantics. Jan
* Add lztext to TypeCategory so that lztext OP text cases will workTom Lane2000-02-27
| | | | correctly (the lztext value will be promoted to text automatically).
* Fix poorly worded error messages for unary operator type resolutionTom Lane2000-02-27
| | | | | | | 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
* Fix exprTypmod to recognize length-coercion function expressions,Tom Lane2000-02-26
| | | | | | | | | | | 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.
* I had managed to break acceptance of "char", which worked in 6.5 toTom Lane2000-02-26
| | | | refer to the single-byte char type. 7.0 was taking it as bpchar(1).
* Suppress timespan and datetime ops from being brought in via pg_dumpBruce Momjian2000-02-24
| | | | from previous release.
* Make make_const() check the size and precision of a T_Float Value,Tom Lane2000-02-24
| | | | | | | | and produce either FLOAT8 or NUMERIC output depending on whether the value fits in a float8 or not. This is almost back to the way the code was before I changed T_Float, but there is a critical difference: now, when a numeric constant doesn't fit in float8, it will be treated as type NUMERIC instead of type UNKNOWN.
* First post-beta1 bug fix :-(. Silly typo in new coding for doNegateTom Lane2000-02-22
| | | | | failed to negate a negative value back to positive, so '- - 123.45' did the wrong thing.
* Change parse-time representation of float literals (which include oversizeTom Lane2000-02-21
| | | | | | | | integers) to be strings instead of 'double'. We convert from string form to internal representation only after type resolution has determined the correct type for the constant. This eliminates loss-of-precision worries and gets rid of the change in behavior seen at 17 digits with the previous kluge.
* Further cleanups for type coercion: treat the locution typename(argument)Tom Lane2000-02-20
| | | | | | | as representing a type coercion request in more cases than we did before. It will work now whenever no underlying function is required, ie if the coercion is binary-compatible or if the argument is a previously untyped string constant. Otherwise, you still need a real function to exist.
* Create a new expression node type RelabelType, which exists solely toTom Lane2000-02-20
| | | | | | | | | | represent the result of a binary-compatible type coercion. At runtime it just evaluates its argument --- but during type resolution, exprType will pick up the output type of the RelabelType node instead of the type of the argument. This solves some longstanding problems with dropped type coercions, an example being 'select now()::abstime::int4' which used to produce date-formatted output, not an integer, because the coercion to int4 was dropped on the floor.
* Fix broken list-slinging logic in func_select_candidate andTom Lane2000-02-20
| | | | | | | | | | | agg_select_candidate, which could cause them to keep more candidates than they should and thus fail to select a single match. I had previously fixed the identical bug in oper_select_candidate, but didn't realize that the same error was repeated over here. Also, repair func_select_candidate's curious notion that it could scribble on the input type-OID vector. That was causing failure to apply necessary type coercion later on, leading to malfunction of examples such as select date('now').
* Even after the great date/time consolidation, TypeCategory() was stillTom Lane2000-02-20
| | | | | | | | | a few bricks shy of a load concerning knowing all the date/time types. This is real bad because it interferes with func_select_candidate()'s willingness to disambiguate functions --- func_select_candidate() will punt unless all the available choices have the same type category. I think this whole mechanism needs redesigned, but in the meantime this is a needed patch.
* Fix SERIAL columns, which Thomas inadvertently broke parsing of.Tom Lane2000-02-20
| | | | | Revised code probably accepts some silly combinations, but that's better than not accepting valid ones.
* Repair longstanding violation of SQL92 semantics: GROUP BY wouldTom Lane2000-02-19
| | | | | | | | | | | | | | interpret a column name as an output column alias (targetlist AS name), ather than a real column name as it ought to. According to the spec, only ORDER BY should look at output column names. I left in GROUP BY's willingness to use an output column number ('GROUP BY 2'), even though this is also contrary to the spec --- again, only ORDER BY is supposed to accept that. But there is no possible reason to want to GROUP BY an integer constant, so keeping this old behavior won't break any SQL-compliant queries. DISTINCT ON will behave the same as GROUP BY. Change numerology regress test, which depended on the incorrect behavior.
* Accept the noise-word ALL in aggregate function invocations for SQL92Tom Lane2000-02-19
| | | | compliance. Wish they were all that easy...
* First workaround solution for Jan's column constraint attributes.Thomas G. Lockhart2000-02-19
|
* Clean up scan.l's handling of \r vs \n --- they are reliably treated asTom Lane2000-02-19
| | | | | | equivalent now, which should make Windows and Mac clients happier. Also fix failure to handle SQL comments between segments of a multiline quoted literal.
* Implement reindex commandHiroshi Inoue2000-02-18
|
* Implement "date/time grand unification".Thomas G. Lockhart2000-02-16
| | | | | | | | | | | | | Transform datetime and timespan into timestamp and interval. Deprecate datetime and timespan, though translate to new types in gram.y. Transform all datetime and timespan catalog entries into new types. Make "INTERVAL" reserved word allowed as a column identifier in gram.y. Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility routines for all date/time types. date.{h,c} now deals with date, time types. timestamp.{h,c} now deals with timestamp, interval types. nabstime.{h,c} now deals with abstime, reltime, tinterval types. Make NUMERIC a known native type for purposes of type coersion. Not tested.
* Fix missing lfirst() in ListTableAsAttrs(). This codeTom Lane2000-02-15
| | | | doesn't seem to be used at the moment, but as long as I'm looking at it...
* Remove some // comments, which are not ANSI C last I heard.Tom Lane2000-02-15
|
* Carry column aliases from the parser frontend. Enables queries likeThomas G. Lockhart2000-02-15
| | | | | | | SELECT a FROM t1 tx (a); Allow join syntax, including queries like SELECT * FROM t1 NATURAL JOIN t2; Update RTE structure to hold column aliases in an Attr structure.
* Add "DEC" as synonym for "DECIMAL".Thomas G. Lockhart2000-02-15
| | | | | | Add "SESSION_USER" as SQL92 keyword; equivalent to CURRENT_USER for now. Implement column aliases (aka correlation names) and more join syntax. Fix up indenting and tabbing.
* Mask removal of network_ops in 7.0.Bruce Momjian2000-02-07
|
* Enabled MATCH <unspecified>Jan Wieck2000-02-07
| | | | Jan
* Enabling automatic primary key detection for self-referencingJan Wieck2000-02-05
| | | | | | FOREIGN KEY constraint during CREATE TABLE. Tnx to Stephan. Jan
* Added ALTER TABLE ... ADD CONSTRAINT (provided by Stephan Szabo).Jan Wieck2000-02-04
| | | | | | | | | | | Added constraint dumping capability to pg_dump (also from Stephan) Fixed DROP TABLE -> RelationBuildTriggers: 2 record(s) not found for rel error. Fixed little error in gram.y I made the last days. Jan
* Inconsistency in CREATE CONSTRAINT TRIGGER with theJan Wieck2000-02-02
| | | | | | actions performed by analyse.c when creating table constraints. Jan
* A few minor psql enhancementsPeter Eisentraut2000-01-29
| | | | | | | Initdb help correction Changed end/abort to commit/rollback and changed related notices Commented out way old printing functions in libpq Fixed a typo in alter table / alter column
* Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is nowTom Lane2000-01-27
| | | | | | | | | | | | | SELECT DISTINCT ON (expr [, expr ...]) targetlist ... and there is a check to make sure that the user didn't specify an ORDER BY that's incompatible with the DISTINCT operation. Reimplement nodeUnique and nodeGroup to use the proper datatype-specific equality function for each column being compared --- they used to do bitwise comparisons or convert the data to text strings and strcmp(). (To add insult to injury, they'd look up the conversion functions once for each tuple...) Parse/plan representation of DISTINCT is now a list of SortClause nodes. initdb forced by querytree change...
* Add:Bruce Momjian2000-01-26
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* Made abstime/reltime use int4 instead of time_t (TODO item)Peter Eisentraut2000-01-24
| | | | | | Made type equivalency apply to aggregates (TODO item) Fixed parsing bug in psql Reverted some stupid options changes I made to pg_dump
* Fix error messages for the lack of multi-byte support.Tatsuo Ishii2000-01-23
| | | | | Since --with-mb has been removed from configure, previous messages were not appropriate.
* updated install filePeter Eisentraut2000-01-23
| | | | | | | updated date/time types doc fixed small psql bug removed libpq code that lower-cased db names make notice when long identifier is truncated
* added ALTER TABLE DROP COLUMN, early versionPeter Eisentraut2000-01-22
|
* Forgot to handle column length defaults in ALTER TABLE ADD COLUMN.Tom Lane2000-01-22
|