aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_func.c
Commit message (Collapse)AuthorAge
...
* Another go-round with resolution of ambiguous functions and operators.Tom Lane2000-03-19
| | | | | | | | | | 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.
* 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.
* 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.
* 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.
* 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').
* 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: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
* Make number of args to a function configurable.Bruce Momjian2000-01-10
|
* Some changes to prepare for LONG attributes.Jan Wieck1999-12-16
| | | | Jan
* Teach grammar and parser about aggregate(DISTINCT ...). No implementationTom Lane1999-12-10
| | | | | | | yet, but at least we can give a better error message: regression=> select count(distinct f1) from int4_tbl; ERROR: aggregate(DISTINCT ...) is not implemented yet instead of 'parser: parse error at or near distinct'.
* Clean up memory leakage in find_inheritors() by using pg_list listsTom Lane1999-12-07
| | | | | | (which are palloc'd) instead of DLLists (which are malloc'd). Not very significant, since this routine seldom has anything useful to do, but a leak is a leak...
* Add system indexes to match all caches.Bruce Momjian1999-11-22
| | | | | | | Make all system indexes unique. Make all cache loads use system indexes. Rename *rel to *relid in inheritance tables. Rename cache names to be clearer.
* New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian1999-11-07
| | | | | | Fewer calls to nameout. Better use of RelationGetRelationName.
* Fix planner and rewriter to follow SQL semantics for tables that areTom Lane1999-10-07
| | | | | | | | | | | mentioned in FROM but not elsewhere in the query: such tables should be joined over anyway. Aside from being more standards-compliant, this allows removal of some very ugly hacks for COUNT(*) processing. Also, allow HAVING clause without aggregate functions, since SQL does. Clean up CREATE RULE statement-list syntax the same way Bruce just fixed the main stmtmulti production. CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules; you will have to initdb if you have any rules.
* Disable new FROM-clause warning.Bruce Momjian1999-09-29
|
* Add subquery mention in auto-create table entry.Bruce Momjian1999-09-28
|
* Reverse out last scan.l patch for minus handling.\Bruce Momjian1999-09-28
|
* Emit warning on SELECT pg_language.*Bruce Momjian1999-09-27
|
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-18
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Further planner/optimizer cleanups. Move all set_tlist_referencesTom Lane1999-08-22
| | | | | | | | | | and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
* Major revision of sort-node handling: push knowledge of queryTom Lane1999-08-21
| | | | | | | | | | | | | sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb.
* Move funcid_get_rettype() to lsyscache.Tom Lane1999-08-16
|
* Revise parse_coerce() to handle coercion of int and floatTom Lane1999-08-05
| | | | | constants, not only string constants, at parse time. Get rid of parser_typecast2(), which is bogus and redundant...
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Final cleanup.Bruce Momjian1999-07-16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Defend against function calls with more than 8 arguments (codeTom Lane1999-06-17
| | | | | used to overrun its fixed-size arrays before detecting error; not cool). Also, replace uses of magic constant '8' with 'MAXFARGS'.
* pgindent run over code.Bruce Momjian1999-05-25
|
* Fix for DEFAULT ''.Bruce Momjian1999-05-22
|
* Change resjunk to a boolean.Bruce Momjian1999-05-17
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-10
| | | | real affect now.
* Update nextval() code.Bruce Momjian1999-03-16
|
* Fix snprintf with strings, and nextval('"Aa"');Bruce Momjian1999-03-16
|
* Allow sequence nextval actions to be case-sensitive.Bruce Momjian1999-03-15
|
* Do a better job of selecting candidates among functionsThomas G. Lockhart1999-02-23
| | | | | when no exact match. Clean up elog error messages.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-03
|
* Fix reference to null pointer when no aggregate function candidatesThomas G. Lockhart1998-12-23
| | | | | | are available. Problem reported by David Sauer <davids@iol.cz>. Modify information in resulting error message to indicate both agg name and data type.
* Initial MVCC code.Vadim B. Mikheev1998-12-15
| | | | New code for locking buffer' context.
* Fix up error messages when looking up functions and operators to notThomas G. Lockhart1998-12-13
| | | | | make the sometimes misleading claim that more than one candidate was identified. Now say "Unable to identify...".
* I have a simple patch about the treatment of functions.Bruce Momjian1998-12-13
| | | | | | | | | | But it may be self-satisfied. Please check my patch at the end of this posting. Case 1. executor evaluates functions twice Hiroshi Inoue Inoue@tpf.co.jp
* Define routines and catalog entries for string min()/max() functions.Thomas G. Lockhart1998-12-08
| | | | | Extend new type coersion techniques to aggregates. Clean up a few elog() messages.
* New HeapTuple structure/interface.Vadim B. Mikheev1998-11-27
|
* Make functions static or ifdef NOT_USED. Prevent pg_version creation.Bruce Momjian1998-10-08
|
* Clean up code in analyze.c for SERIAL data type.Thomas G. Lockhart1998-09-25
| | | | Remove _all_ PARSEDEBUG print statements.
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-01
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-01
|