- 20 8月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
-
- 16 8月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
To reduce our diff vs upstream, to make diffing and merging easier.
-
- 06 6月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
This is a partial backport of a larger body of work which also already have been partially backported. Remove the GPDB-specific "breadcrumbs" mechanism from the parser. It is made obsolete by the upstream mechanism. We lose context information from a few errors, which is unfortunate, but seems acceptable. Upstream doesn't have context information for those errors either. The backport was originally done by Daniel Gustafsson, on top of the PostgreSQL 8.3 merge. I tweaked it to apply it to master, before the merge. Upstream commit: commit b153c092 Author: Tom Lane <tgl@sss.pgh.pa.us> Date: Mon Sep 1 20:42:46 2008 +0000 Add a bunch of new error location reports to parse-analysis error messages. There are still some weak spots around JOIN USING and relation alias lists, but most errors reported within backend/parser/ now have locations.
-
- 14 4月, 2016 1 次提交
-
-
由 Atri Sharma 提交于
-
- 02 4月, 2016 1 次提交
-
-
由 Haozhou Wang 提交于
Backport below commits from upstream: commit 31edbadf Author: Tom Lane <tgl@sss.pgh.pa.us> Date: Tue Jun 5 21:31:09 2007 +0000 Downgrade implicit casts to text to be assignment-only, except for the ones from the other string-category types; this eliminates a lot of surprising interpretations that the parser could formerly make when there was no directly applicable operator. Create a general mechanism that supports casts to and from the standard string types (text,varchar,bpchar) for *every* datatype, by invoking the datatype's I/O functions. These new casts are assignment-only in the to-string direction, explicit-only in the other, and therefore should create no surprising behavior. Remove a bunch of thereby-obsoleted datatype-specific casting functions. The "general mechanism" is a new expression node type CoerceViaIO that can actually convert between *any* two datatypes if their external text representations are compatible. This is more general than needed for the immediate feature, but might be useful in plpgsql or other places in future. This commit does nothing about the issue that applying the concatenation operator || to non-text types will now fail, often with strange error messages due to misinterpreting the operator as array concatenation. Since it often (not always) worked before, we should either make it succeed or at least give a more user-friendly error; but details are still under debate. Peter Eisentraut and Tom Lane commit bf940763 Author: Tom Lane <tgl@sss.pgh.pa.us> Date: Tue Mar 27 23:21:12 2007 +0000 Fix array coercion expressions to ensure that the correct volatility is seen by code inspecting the expression. The best way to do this seems to be to drop the original representation as a function invocation, and instead make a special expression node type that represents applying the element-type coercion function to each array element. In this way the element function is exposed and will be checked for volatility. Per report from Guillaume Smet.
-
- 26 1月, 2016 1 次提交
-
-
由 Kuien Liu 提交于
Functions can be declared with parameters with default values or expressions. The default expressions are used as parameter value if the parameter is not explicitly specified in a function call. All parameters after a parameter with default value have to be parameters with default values as well. It allows user to invoke a UDF without setting all the parameters. Two examples to demo its usage: CREATE FUNCTION dfunc1(text DEFAULT 'Hello', text DEFAULT 'World') RETURNS text AS $$ SELECT $1 || ', ' || $2; $$ LANGUAGE SQL; SELECT dfunc1(); -- 'Hello, World' SELECT dfunc1('Hi'); -- 'Hi, World' SELECT dfunc1('Hi', 'Beijing'); -- 'Hi, Beijing' CREATE FUNCTION dfunc2(id int4, t timestamp DEFAULT now()) RETURNS text AS $$ SELECT 'Time for id:' || $1 || ' is ' || $2; $$ LANGUAGE SQL; SELECT dfunc2(24); -- 'Time for id:24 is 2016-01-07 14:38' NOTE: The default change set is ported from from PostgreSQL 8.4, original commits: '517ae403' '455dffbb'
-
- 28 10月, 2015 1 次提交
-
-
- 15 12月, 2008 1 次提交
-
-
由 Tom Lane 提交于
actual argument type of ANYARRAY to match an argument declared ANYARRAY, so long as ANYELEMENT etc aren't used. I had overlooked the fact that this is a possible case while fixing bug #3852; but it is possible because pg_statistic contains columns declared ANYARRAY. Per gripe from Corey Horton.
-
- 26 10月, 2008 1 次提交
-
-
由 Tom Lane 提交于
into an OR of equality comparisons, rather than x = ANY(ARRAY[...]), when there are Vars in the right-hand side. This avoids a performance regression compared to pre-8.2 releases, in cases where the OR form can be optimized into scans of multiple indexes. Limit the possible downside by preferring this form only when the list isn't very long (I set the cutoff at 32 elements, which is a bit arbitrary but in the right ballpark). Per discussion with Jim Nasby. In passing, also make it try the OR form if it cannot select a common type for the array elements; we've seen a complaint or two about how the OR form worked for such cases and ARRAY doesn't.
-
- 12 1月, 2008 1 次提交
-
-
由 Tom Lane 提交于
checking of argument compatibility right; although the problem is only exposed with multiple-input aggregates in which some arguments are polymorphic and some are not. Per bug #3852 from Sokolov Yura.
-
- 02 1月, 2008 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 27 11月, 2007 1 次提交
-
-
由 Tom Lane 提交于
to a UNION, CASE, or related construct are of the same domain type. The main part of this routine smashes domains to their base types, which seems necessary because the logic involves TypeCategory() and IsPreferredType(), neither of which work usefully on domains. However, we can add a first pass that just detects whether all the inputs are exactly the same type, and if so accept that without question (so long as it's not UNKNOWN). Per recent gripe from Dean Rasheed. In passing, remove some tests for InvalidOid, which have clearly been dead code for quite some time now, because getBaseType() would fail on that input. Also, clarify the manual's not-very-precise description of the existing algorithm's behavior.
-
- 16 11月, 2007 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 07 9月, 2007 1 次提交
-
-
由 Tom Lane 提交于
null::char(3) to a simple Const node. (It already worked for non-null values, but not when we skipped evaluation of a strict coercion function.) This prevents loss of typmod knowledge in situations such as exhibited in bug #3598. Unfortunately there seems no good way to fix that bug in 8.1 and 8.2, because they simply don't carry a typmod for a plain Const node. In passing I made all the other callers of makeNullConst supply "real" typmod values too, though I think it probably doesn't matter anywhere else.
-
- 21 8月, 2007 1 次提交
-
-
由 Tom Lane 提交于
Oleg Bartunov and Teodor Sigaev, but I did a lot of editorializing, so anything that's broken is probably my fault. Documentation is nonexistent as yet, but let's land the patch so we can get some portability testing done.
-
- 07 6月, 2007 1 次提交
-
-
由 Tom Lane 提交于
were accepted by prior Postgres releases. This takes care of the loose end left by the preceding patch to downgrade implicit casts-to-text. To avoid breaking desirable behavior for array concatenation, introduce a new polymorphic pseudo-type "anynonarray" --- the added concatenation operators are actually text || anynonarray and anynonarray || text.
-
- 06 6月, 2007 1 次提交
-
-
由 Tom Lane 提交于
from the other string-category types; this eliminates a lot of surprising interpretations that the parser could formerly make when there was no directly applicable operator. Create a general mechanism that supports casts to and from the standard string types (text,varchar,bpchar) for *every* datatype, by invoking the datatype's I/O functions. These new casts are assignment-only in the to-string direction, explicit-only in the other, and therefore should create no surprising behavior. Remove a bunch of thereby-obsoleted datatype-specific casting functions. The "general mechanism" is a new expression node type CoerceViaIO that can actually convert between *any* two datatypes if their external text representations are compatible. This is more general than needed for the immediate feature, but might be useful in plpgsql or other places in future. This commit does nothing about the issue that applying the concatenation operator || to non-text types will now fail, often with strange error messages due to misinterpreting the operator as array concatenation. Since it often (not always) worked before, we should either make it succeed or at least give a more user-friendly error; but details are still under debate. Peter Eisentraut and Tom Lane
-
- 02 4月, 2007 1 次提交
-
-
由 Tom Lane 提交于
pg_type.typtype whereever practical. Tom Dunstan, with some kibitzing from Tom Lane.
-
- 28 3月, 2007 1 次提交
-
-
由 Tom Lane 提交于
seen by code inspecting the expression. The best way to do this seems to be to drop the original representation as a function invocation, and instead make a special expression node type that represents applying the element-type coercion function to each array element. In this way the element function is exposed and will be checked for volatility. Per report from Guillaume Smet.
-
- 17 3月, 2007 1 次提交
-
-
由 Tom Lane 提交于
available information about the typmod of an expression; namely, Const, ArrayRef, ArrayExpr, and EXPR and ARRAY SubLinks. In the ArrayExpr and SubLink cases it wasn't really the data structure's fault, but exprTypmod() being lazy. This seems like a good idea in view of the expected increase in typmod usage from Teodor's work to allow user-defined types to have typmods. In particular this responds to the concerns we had about eliminating the special-purpose hack that exprTypmod() used to have for BPCHAR Consts. We can now tell whether or not such a Const has been cast to a specific length, and report or display properly if so. initdb forced due to changes in stored rules.
-
- 06 1月, 2007 1 次提交
-
-
由 Bruce Momjian 提交于
back-stamped for this.
-
- 24 12月, 2006 1 次提交
-
-
由 Tom Lane 提交于
the XmlExpr code in various lists, use a representation that has some hope of reverse-listing correctly (though it's still a de-escaping function shy of correctness), generally try to make it look more like Postgres coding conventions.
-
- 22 12月, 2006 1 次提交
-
-
由 Peter Eisentraut 提交于
-
- 11 12月, 2006 1 次提交
-
-
由 Tom Lane 提交于
representing externally-supplied values, since the APIs that carry such values only specify type not typmod. However, for PARAM_SUBLINK Params it is handy to carry the typmod of the sublink's output column. This is a much cleaner solution for the recently reported 'could not find pathkey item to sort' and 'failed to find unique expression in subplan tlist' bugs than my original 8.2-compatible patch. Besides, someday we might want to support typmods for external parameters ...
-
- 28 11月, 2006 1 次提交
-
-
由 Peter Eisentraut 提交于
not destroy them. Maybe we can adjust pgindent sometime.
-
- 12 10月, 2006 1 次提交
-
-
由 Tom Lane 提交于
I introduced in 7.4.1 :-(. It's correct to allow unknown to be coerced to ANY or ANYELEMENT, since it's a real-enough data type, but it most certainly isn't an array datatype. This can cause a backend crash but AFAICT is not exploitable as a security hole. Per report from Michael Fuhr. Note: as fixed in HEAD, this changes a constant in the pg_stats view, resulting in a change in the expected regression outputs. The back-branch patches have been hacked to avoid that, so that pre-existing installations won't start failing their regression tests.
-
- 04 10月, 2006 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 27 7月, 2006 1 次提交
-
-
由 Tom Lane 提交于
eliminate unnecessary code, force initdb because stored rules change (limit nodes are now supposed to be int8 not int4 expressions). Update comments and error messages, which still all said 'integer'.
-
- 26 7月, 2006 1 次提交
-
-
由 Bruce Momjian 提交于
Dhanaraj M
-
- 14 7月, 2006 2 次提交
-
-
由 Bruce Momjian 提交于
-
由 Bruce Momjian 提交于
Strip unused include files out unused include files, and add needed includes to C files. The next step is to remove unused include files in C files.
-
- 17 6月, 2006 1 次提交
-
-
由 Tom Lane 提交于
by creating a reference-count mechanism, similar to what we did a long time ago for catcache entries. The back branches have an ugly solution involving lots of extra copies, but this way is more efficient. Reference counting is only applied to tupdescs that are actually in caches --- there seems no need to use it for tupdescs that are generated in the executor, since they'll go away during plan shutdown by virtue of being in the per-query memory context. Neil Conway and Tom Lane
-
- 22 4月, 2006 1 次提交
-
-
由 Tom Lane 提交于
not named ones, and replace linear searches of the list with array indexing. The named-parameter support has been dead code for many years anyway, and recent profiling suggests that the searching was costing a noticeable amount of performance for complex queries.
-
- 06 4月, 2006 1 次提交
-
-
由 Tom Lane 提交于
that apply the necessary domain constraint checks immediately. This fixes cases where domain constraints went unchecked for statement parameters, PL function local variables and results, etc. We can also eliminate existing special cases for domains in places that had gotten it right, eg COPY. Also, allow domains over domains (base of a domain is another domain type). This almost worked before, but was disallowed because the original patch hadn't gotten it quite right.
-
- 05 4月, 2006 1 次提交
-
-
由 Tom Lane 提交于
functions are not strict, they will be called (passing a NULL first parameter) during any attempt to input a NULL value of their datatype. Currently, all our input functions are strict and so this commit does not change any behavior. However, this will make it possible to build domain input functions that centralize checking of domain constraints, thereby closing numerous holes in our domain support, as per previous discussion. While at it, I took the opportunity to introduce convenience functions InputFunctionCall, OutputFunctionCall, etc to use in code that calls I/O functions. This eliminates a lot of grotty-looking casts, but the main motivation is to make it easier to grep for these places if we ever need to touch them again.
-
- 05 3月, 2006 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 13 1月, 2006 1 次提交
-
-
由 Neil Conway 提交于
prepared statements, per report from David Wheeler.
-
- 23 11月, 2005 1 次提交
-
-
由 Bruce Momjian 提交于
comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
-
- 15 10月, 2005 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 05 6月, 2005 1 次提交
-
-
由 Tom Lane 提交于
RTE of interest, rather than the whole rangetable list. This makes the API more understandable and avoids duplicate RTE lookups. This patch reverts no-longer-needed portions of my patch of 2004-08-19.
-