summaryrefslogtreecommitdiff
path: root/src/include/parser/parse_func.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove cvs keywords from all files.Magnus Hagander2010-09-201-1/+1
|
* In HEAD only, revert kluge solution for preventing misuse of pg_get_expr().Tom Lane2010-09-031-3/+1
| | | | | A data-type-based solution, which is much cleaner and more bulletproof, will follow shortly. It seemed best to make this a separate commit though.
* Improved version of patch to protect pg_get_expr() against misuse:Tom Lane2010-07-291-1/+3
| | | | | | | | | | | look through join alias Vars to avoid breaking join queries, and move the test to someplace where it will catch more possible ways of calling a function. We still ought to throw away the whole thing in favor of a data-type-based solution, but that's not feasible in the back branches. This needs to be back-patched further than 9.0, but I don't have time to do so today. Committing now so that the fix gets into 9.0beta4.
* Update copyright for the year 2010.Bruce Momjian2010-01-021-2/+2
|
* Support ORDER BY within aggregate function calls, at long last providing aTom Lane2009-12-151-2/+3
| | | | | | | | | | | | | non-kluge method for controlling the order in which values are fed to an aggregate function. At the same time eliminate the old implementation restriction that DISTINCT was only supported for single-argument aggregates. Possibly release-notable behavioral change: formerly, agg(DISTINCT x) dropped null values of x unconditionally. Now, it does so only if the agg transition function is strict; otherwise nulls are treated as DISTINCT normally would, ie, you get one copy. Andrew Gierth, reviewed by Hitoshi Harada
* Support use of function argument names to identify which actual argumentsTom Lane2009-10-081-6/+7
| | | | | | | match which function parameters. The syntax uses AS, for example funcname(value AS arg1, anothervalue AS arg2) Pavel Stehule
* Do some minor code refactoring in preparation for changing the APIs ofTom Lane2009-05-121-3/+1
| | | | | | | | | | | | | | | | | find_inheritance_children() and find_all_inheritors(). I got annoyed that these are buried inside the planner but mostly used elsewhere. So, create a new file catalog/pg_inherits.c and put them there, along with a couple of other functions that search pg_inherits. The code that modifies pg_inherits is (still) in tablecmds.c --- it's kind of entangled with unrelated code that modifies pg_depend and other stuff, so pulling it out seemed like a bigger change than I wanted to make right now. But this file provides a natural home for it if anyone ever gets around to that. This commit just moves code around; it doesn't change anything, except I succumbed to the temptation to make a couple of trivial optimizations in typeInheritsFrom().
* Update copyright for 2009.Bruce Momjian2009-01-011-2/+2
|
* Support window functions a la SQL:2008.Tom Lane2008-12-281-2/+3
| | | | Hitoshi Harada, with some kibitzing from Heikki and Tom.
* Code review for function default parameters patch. Fix numerous problems asTom Lane2008-12-181-2/+3
| | | | | per recent discussions. In passing this also fixes a couple of bugs in the previous variadic-parameters patch.
* Default values for function argumentsPeter Eisentraut2008-12-041-2/+3
| | | | Pavel Stehule, with some tweaks by Peter Eisentraut
* Support "variadic" functions, which can accept a variable number of argumentsTom Lane2008-07-161-5/+5
| | | | | | | | | | | | | | so long as all the trailing arguments are of the same (non-array) type. The function receives them as a single array argument (which is why they have to all be the same type). It might be useful to extend this facility to aggregates, but this patch doesn't do that. This patch imposes a noticeable slowdown on function lookup --- a follow-on patch will fix that by adding a redundant column to pg_proc. Pavel Stehule
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-011-2/+2
|
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-051-2/+2
| | | | back-stamped for this.
* pgindent run for 8.2.Bruce Momjian2006-10-041-2/+2
|
* Support the syntaxTom Lane2006-04-151-3/+3
| | | | | | | | | | | | | | CREATE AGGREGATE aggname (input_type) (parameter_list) along with the old syntax where the input type was named in the parameter list. This fits more naturally with the way that the aggregate is identified in DROP AGGREGATE and other utility commands; furthermore it has a natural extension to handle multiple-input aggregates, where the basetype-parameter method would get ugly. In fact, this commit fixes the grammar and all the utility commands to support multiple-input aggregates; but DefineAggregate rejects it because the executor isn't fixed yet. I didn't do anything about treating agg(*) as a zero-input aggregate instead of artificially making it a one-input aggregate, but that should be considered in combination with supporting multi-input aggregates.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-141-2/+3
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-051-2/+2
|
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-311-2/+2
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Update copyright to 2004.Bruce Momjian2004-08-291-2/+2
|
* make sure the $Id tags are converted to $PostgreSQL as well ...PostgreSQL Daemon2003-11-291-1/+1
|
* Update copyrights to 2003.Bruce Momjian2003-08-041-2/+2
|
* pgindent run.Bruce Momjian2003-08-041-16/+16
|
* Another round of error message editing, covering backend/commands/.Tom Lane2003-07-201-1/+3
|
* Some early work on error message editing. Operator-not-found andTom Lane2003-07-041-9/+9
| | | | | function-not-found messages now distinguish the cases no-match and ambiguous-match, and they follow the style guidelines too.
* Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailingTom Lane2003-05-261-1/+11
| | | | | | | | | | | | | | | | | | blanks, in hopes of reducing the surprise factor for newbies. Remove redundant operators for VARCHAR (it depends wholly on TEXT operations now). Clean up resolution of ambiguous operators/functions to avoid surprising choices for domains: domains are treated as equivalent to their base types and binary-coercibility is no longer considered a preference item when choosing among multiple operators/functions. IsBinaryCoercible now correctly reflects the notion that you need *only* relabel the type to get from type A to type B: that is, a domain is binary-coercible to its base type, but not vice versa. Various marginal cleanup, including merging the essentially duplicate resolution code in parse_func.c and parse_oper.c. Improve opr_sanity regression test to understand about binary compatibility (using pg_cast), and fix a couple of small errors in the catalogs revealed thereby. Restructure "special operator" handling to fetch operators via index opclasses rather than hardwiring assumptions about names (cleans up the pattern_ops stuff a little).
* Infrastructure for deducing Param types from context, in the same wayTom Lane2003-04-291-2/+4
| | | | | | | | | | | that the types of untyped string-literal constants are deduced (ie, when coerce_type is applied to 'em, that's what the type must be). Remove the ancient hack of storing the input Param-types array as a global variable, and put the info into ParseState instead. This touches a lot of files because of adjustment of routine parameter lists, but it's really not a large patch. Note: PREPARE statement still insists on exact specification of parameter types, but that could easily be relaxed now, if we wanted to do so.
* First phase of work on array improvements. ARRAY[x,y,z] constructorTom Lane2003-04-081-1/+5
| | | | | | | expressions, ARRAY(sub-SELECT) expressions, some array functions. Polymorphic functions using ANYARRAY/ANYELEMENT argument and return types. Some regression tests in place, documentation is lacking. Joe Conway, with some kibitzing from Tom Lane.
* pgindent run.Bruce Momjian2002-09-041-7/+7
|
* Add a bunch of pseudo-types to replace the behavior formerly associatedTom Lane2002-08-221-2/+2
| | | | | | with OPAQUE, as per recent pghackers discussion. I still want to do some more work on the 'cstring' pseudo-type, but I'm going to commit the bulk of the changes now before the tree starts shifting under me ...
* Update copyright to 2002.Bruce Momjian2002-06-201-2/+2
|
* Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR takeTom Lane2002-04-161-11/+1
| | | | | | | | | | qualified operator names directly, for example CREATE OPERATOR myschema.+ ( ... ). To qualify an operator name in an expression you need to write OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch). I also took advantage of having to reformat pg_operator to fix something that'd been bugging me for a while: mergejoinable operators should have explicit links to the associated cross-data-type comparison operators, rather than hardwiring an assumption that they are named < and >.
* Restructure representation of aggregate functions so that they have pg_procTom Lane2002-04-111-2/+6
| | | | | | | | | | entries, per pghackers discussion. This fixes aggregates to live in namespaces, and also simplifies/speeds up lookup in parse_func.c. Also, add a 'proimplicit' flag to pg_proc that controls whether a type coercion function may be invoked implicitly, or only explicitly. The current settings of these flags are more permissive than I would like, but we will need to debate and refine the behavior; for now, I avoided breaking regression tests as much as I could.
* Functions live in namespaces. Qualified function names work, egTom Lane2002-04-091-4/+8
| | | | | SELECT schema1.func2(...). Aggregate names can be qualified at the syntactic level, but the qualification is ignored for the moment.
* pg_type has a typnamespace column; system now supports creating typesTom Lane2002-03-291-3/+4
| | | | | | in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
* First phase of SCHEMA changes, concentrating on fixing the grammar andTom Lane2002-03-211-5/+2
| | | | | | | | the parsetree representation. As yet we don't *do* anything with schema names, just drop 'em on the floor; but you can enter schema-compatible command syntax, and there's even a primitive CREATE SCHEMA command. No doc updates yet, except to note that you can now extract a field from a function-returning-row's result with (foo(...)).fieldname.
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-051-3/+3
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-281-4/+5
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-251-8/+7
| | | | tests pass.
* Consider interpreting a function call as a trivial (binary-compatible)Tom Lane2001-10-041-4/+14
| | | | | | | | | type coercion after failing to find an exact match in pg_proc, but before considering interpretations that involve a function call with one or more argument type coercions. This avoids surprises wherein what looks like a type coercion is interpreted as coercing to some third type and then to the destination type, as in Dave Blasby's bug report of 3-Oct-01. See subsequent discussion in pghackers.
* New comment. This func/column things has always confused me.Bruce Momjian2001-05-191-2/+2
| | | | | | | | | | | | | | | | | | | /* * 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)
* Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian2001-05-181-2/+2
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-221-7/+7
|
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-241-2/+2
|
* First cut at full support for OUTER JOINs. There are still a few looseTom Lane2000-09-121-5/+5
| | | | | ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
* Make functional indexes accept binary-compatible functions, for exampleTom Lane2000-08-201-1/+5
| | | | CREATE INDEX fooi ON foo (lower(f1)) where f1 is varchar rather than text.
* Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'Tom Lane2000-08-081-3/+1
| | | | | | | | from Param nodes, per discussion a few days ago on pghackers. Add new expression node type FieldSelect that implements the functionality where it's actually needed. Clean up some other unused fields in Func nodes as well. NOTE: initdb forced due to change in stored expression trees for rules.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-121-5/+5
|
* Turns out that Mazurkiewicz's gripe about 'function inheritance' isTom Lane2000-03-161-1/+3
| | | | | | 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.
* Add:Bruce Momjian2000-01-261-2/+3
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.