aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_func.c
Commit message (Collapse)AuthorAge
...
* Make ruleutils.c schema-aware. Displayed names are schema-qualifiedTom Lane2002-05-03
| | | | | only if they would not be found without qualification given the current search path, as per idea from Peter Eisentraut.
* Restructure representation of aggregate functions so that they have pg_procTom Lane2002-04-11
| | | | | | | | | | 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-09
| | | | | SELECT schema1.func2(...). Aggregate names can be qualified at the syntactic level, but the qualification is ignored for the moment.
* Implement partial-key searching of syscaches, per recent suggestionTom Lane2002-04-06
| | | | | to pghackers. Use this to do searching for ambiguous functions --- it will get more uses soon.
* Divide functions into three volatility classes (immutable, stable, andTom Lane2002-04-05
| | | | | | | volatile), rather than the old cachable/noncachable distinction. This allows indexscan optimizations in many places where we formerly didn't. Also, add a pronamespace column to pg_proc (it doesn't do anything yet, however).
* Mop-up some infelicities in new relation lookup handling.Tom Lane2002-03-29
|
* pg_type has a typnamespace column; system now supports creating typesTom Lane2002-03-29
| | | | | | in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
* A little further progress on schemas: push down RangeVars intoTom Lane2002-03-22
| | | | | | | addRangeTableEntry calls. Remove relname field from RTEs, since it will no longer be a useful unique identifier of relations; we want to encourage people to rely on the relation OID instead. Further work on dumping qual expressions in EXPLAIN, too.
* First phase of SCHEMA changes, concentrating on fixing the grammar andTom Lane2002-03-21
| | | | | | | | 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.
* Code review for DOMAIN patch.Tom Lane2002-03-20
|
* Restructure representation of join alias variables. An explicit JOINTom Lane2002-03-12
| | | | | | | | | | | | | | | now has an RTE of its own, and references to its outputs now are Vars referencing the JOIN RTE, rather than CASE-expressions. This allows reverse-listing in ruleutils.c to use the correct alias easily, rather than painfully reverse-engineering the alias namespace as it used to do. Also, nested FULL JOINs work correctly, because the result of the inner joins are simple Vars that the planner can cope with. This fixes a bug reported a couple times now, notably by Tatsuo on 18-Nov-01. The alias Vars are expanded into COALESCE expressions where needed at the very end of planning, rather than during parsing. Also, beginnings of support for showing plan qualifier expressions in EXPLAIN. There are probably still cases that need work. initdb forced due to change of stored-rule representation.
* A bunch of changes aimed at reducing backend startup time...Tom Lane2002-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | Improve 'pg_internal.init' relcache entry preload mechanism so that it is safe to use for all system catalogs, and arrange to preload a realistic set of system-catalog entries instead of only the three nailed-in-cache indexes that were formerly loaded this way. Fix mechanism for deleting out-of-date pg_internal.init files: this must be synchronized with transaction commit, not just done at random times within transactions. Drive it off relcache invalidation mechanism so that no special-case tests are needed. Cache additional information in relcache entries for indexes (their pg_index tuples and index-operator OIDs) to eliminate repeated lookups. Also cache index opclass info at the per-opclass level to avoid repeated lookups during relcache load. Generalize 'systable scan' utilities originally developed by Hiroshi, move them into genam.c, use in a number of places where there was formerly ugly code for choosing either heap or index scan. In particular this allows simplification of the logic that prevents infinite recursion between syscache and relcache during startup: we can easily switch to heapscans in relcache.c when and where needed to avoid recursion, so IndexScanOK becomes simpler and does not need any expensive initialization. Eliminate useless opening of a heapscan data structure while doing an indexscan (this saves an mdnblocks call and thus at least one kernel call).
* Don't accept names of complex types (ie, relation types) as beingTom Lane2001-12-12
| | | | | | | requests for implicit trivial coercions. Prevents sillinesses like this one: regression=# select x.int8_tbl.q1 from int8_tbl x; ERROR: fmgr_info: function 270997776: cache lookup failed
* Clean up a bunch of ScanKeyEntryInitialize calls that weren't botheringTom Lane2001-11-12
| | | | to apply the proper Datum conversion macros to search key values.
* Fix problem reported by Alex Korn: if a relation has been dropped andTom Lane2001-11-02
| | | | | | | | | | | | | | | | | | recreated since the start of our transaction, our first reference to it errored out because we'd try to reuse our old relcache entry for it. Do this by accepting SI inval messages just before relcache search in heap_openr, so that dead relcache entries will be flushed before we search. Also, break heap_open/openr into two pairs of routines, relation_open(r) and heap_open(r). The relation_open routines make no tests on relkind and so can be used to open anything that has a pg_class entry. The heap_open routines are wrappers that add a relkind test to preserve their established behavior. Use the relation_open routines in several places that had various kluge solutions for opening rels that might be either heap or index rels. Also, remove the old 'heap stats' code that's been superseded by Jan's stats collector, and clean up some inconsistencies in error reporting between the different types of ALTER TABLE.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Consider interpreting a function call as a trivial (binary-compatible)Tom Lane2001-10-04
| | | | | | | | | 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.
* Use format_type sibling in backend error messages, so the user seesPeter Eisentraut2001-08-09
| | | | consistent type naming.
* Statistical system views (yet without the config stuff, butJan Wieck2001-06-22
| | | | | | | 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
* Comment additions in parser.Bruce Momjian2001-05-19
|
* Move ParserFuncOrColumn function higher in the file.Bruce Momjian2001-05-19
|
* New comment. This func/column things has always confused me.Bruce Momjian2001-05-19
| | | | | | | | | | | | | | | | | | | /* * 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)
* Undo \dT change. Not worth it.Bruce Momjian2001-05-18
|
* Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian2001-05-18
|
* Small code cleanups,formatting.Bruce Momjian2001-05-18
|
* Further tweaking of error messages for cases involving attributes &Tom Lane2001-04-18
| | | | | | 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.
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Give a more reasonable error message for a bad attribute name appliedTom Lane2001-03-14
| | | | to a join or subselect alias ... cf. Oliver Elphick's complaint 13-Mar.
* Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane2001-02-14
| | | | | | | | | 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.
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Remove no-longer-needed restriction against referencing systemTom Lane2001-01-23
| | | | | | 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 ...
* Fix portability problems recently exposed by regression tests on Alphas.Tom Lane2000-12-27
| | | | | | | | | | 1. Distinguish cases where a Datum representing a tuple datatype is an OID from cases where it is a pointer to TupleTableSlot, and make sure we use the right typlen in each case. 2. Make fetchatt() and related code support 8-byte by-value datatypes on machines where Datum is 8 bytes. Centralize knowledge of the available by-value datatype sizes in two macros in tupmacs.h, so that this will be easier if we ever have to do it again.
* Make algorithm for resolving UNKNOWN function/operator inputs beTom Lane2000-12-15
| | | | insensitive to the order of arguments. Per pghackers discussion 12/10/00.
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-16
| | | | | | | maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
* Fix bug in recent improvement to type resolution code. Forgot to retainThomas G. Lockhart2000-11-11
| | | | | "best choice" type category when resolving UNKNOWN function and operator arguments. Thanks to Tom Lane for finding test case.
* Allow type resolution for UNKNOWN arguments to functions to fall back toThomas G. Lockhart2000-11-06
| | | | | | | any available string type. Previously, all candidate choices must have fallen within the same "type category" for PostgreSQL to be willing to choose any of them. Need to apply the same fixup to operator type resolution.
* Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.Tom Lane2000-09-29
| | | | | | | | | (Don't forget that an alias is required.) Views reimplemented as expanding to subselect-in-FROM. Grouping, aggregates, DISTINCT in views actually work now (he says optimistically). No UNION support in subselects/views yet, but I have some ideas about that. Rule-related permissions checking moved out of rewriter and into executor. INITDB REQUIRED!
* First cut at full support for OUTER JOINs. There are still a few looseTom Lane2000-09-12
| | | | | ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
* SQL-language functions are now callable in ordinary fmgr contexts ...Tom Lane2000-08-24
| | | | | | for example, an SQL function can be used in a functional index. (I make no promises about speed, but it'll work ;-).) Clean up and simplify handling of functions returning sets.
* Make functional indexes accept binary-compatible functions, for exampleTom Lane2000-08-20
| | | | 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-08
| | | | | | | | 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.
* Modify heap_open()/heap_openr() API per pghackers discussion of 11 July.Tom Lane2000-08-03
| | | | | | | | | These two routines will now ALWAYS elog() on failure, whether you ask for a lock or not. If you really want to get a NULL return on failure, call the new routines heap_open_nofail()/heap_openr_nofail(). By my count there are only about three places that actually want that behavior. There were rather more than three places that were missing the check they needed to make under the old convention :-(.
* Final #include cleanup.Bruce Momjian2000-06-15
|
* Clean up #include's.Bruce Momjian2000-06-15
|
* Update sequence-related functions to new fmgr style. Remove downcasing,Tom Lane2000-06-11
| | | | | | | | quote-stripping, and acl-checking tasks for these functions from the parser, and do them at function execution time instead. This fixes the failure of pg_dump to produce correct output for nextval(Foo) used in a rule, and also eliminates the restriction that the argument of these functions must be a parse-time constant.
* New warning code about auto-created range table entries.Bruce Momjian2000-06-03
|
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-30
|
* First round of changes for new fmgr interface. fmgr itself and theTom Lane2000-05-28
| | | | | | | 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.
* Generate a reasonable error message when an aggregate function is appliedTom Lane2000-05-26
| | | | to an undecorated relation name (cf. example from Ed Loehr, 5/25/00).
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|