- Apr 01, 2015
-
-
Tom Lane authored
You're required to write either RANGE or ROWS to start a frame clause, but the documentation incorrectly implied this is optional. Noted by David Johnston.
-
- Dec 18, 2014
-
-
Tom Lane authored
The possibility that constant subexpressions of a CASE might be evaluated at planning time was touched on in 9.17.1 (CASE expressions), but it really ought to be explained in 4.2.14 (Expression Evaluation Rules) which is the primary discussion of such topics. Add text and an example there, and revise the <note> under CASE to link there. Back-patch to all supported branches, since it's acted like this for a long time (though 9.2+ is probably worse because of its more aggressive use of constant-folding via replanning of nominally-prepared statements). Pre-9.4, also back-patch text added in commit 0ce627d4 about CASE versus aggregate functions. Tom Lane and David Johnston, per discussion of bug #12273.
-
- Nov 06, 2013
-
-
Tom Lane authored
These things didn't work because the planner omitted to do the necessary preprocessing of a WindowFunc's argument list. Add the few dozen lines of code needed to handle that. Although this sounds like a feature addition, it's really a bug fix because the default-argument case was likely to crash previously, due to lack of checking of the number of supplied arguments in the built-in window functions. It's not a security issue because there's no way for a non-superuser to create a window function definition with defaults that refers to a built-in C function, but nonetheless people might be annoyed that it crashes rather than producing a useful error message. So back-patch as far as the patch applies easily, which turns out to be 9.2. I'll put a band-aid in earlier versions as a separate patch. (Note that these features still don't work for aggregates, and fixing that case will be harder since we represent aggregate arg lists as target lists not bare expression lists. There's no crash risk though because CREATE AGGREGATE doesn't accept defaults, and we reject named-argument notation when parsing an aggregate call.)
-
Tom Lane authored
For rather inscrutable reasons, SQL:2008 disallows copying-and-modifying a window definition that has any explicit framing clause. The error message we gave for this only made sense if the referencing window definition itself contains an explicit framing clause, which it might well not. Moreover, in the context of an OVER clause it's not exactly obvious that "OVER (windowname)" implies copy-and-modify while "OVER windowname" does not. This has led to multiple complaints, eg bug #5199 from Iliya Krapchatov. Change to a hopefully more intelligible error message, and in the case where we have just "OVER (windowname)", add a HINT suggesting that omitting the parentheses will fix it. Also improve the related documentation. Back-patch to all supported branches.
-
- Aug 28, 2012
-
-
Tom Lane authored
This is so that these sections will have stable HTML tags that one can link to, rather than things like "AEN1902". Perhaps we should mount a campaign to do this everywhere, but I've found myself pointing at syntax.sgml subsections often enough to be sure it's useful here.
-
- Oct 01, 2011
-
-
Tom Lane authored
We'll now use "exists" for EXISTS(SELECT ...), "array" for ARRAY(SELECT ...), or the sub-select's own result column name for a simple expression sub-select. Previously, you usually got "?column?" in such cases. Marti Raudsepp, reviewed by Kyotaro Horiugchi
-
- Jul 14, 2011
-
-
Bruce Momjian authored
than "*"; it is confusing to start a sentence with a symbol.
-
- May 04, 2011
-
-
Tom Lane authored
Per gripe from Grzegorz Szpetkowski. Also, change the subsection heading from "Lexical Precedence" (which is a contradiction in terms) to "Operator Precedence".
-
- Apr 08, 2011
-
-
Tom Lane authored
As noted by Thom Brown, this confuses the DocBook index processor; it fails to merge entries that differ only in whitespace, and sorts them unexpectedly as well. Seems like a toolchain bug, but I'm not going to hold my breath waiting for a fix. Note: easiest way to find these is to look for double spaces in HTML.index.
-
- Mar 20, 2011
-
-
Bruce Momjian authored
-
- Mar 09, 2011
-
-
Tom Lane authored
-
- Feb 20, 2011
-
-
Bruce Momjian authored
Marko Kreen
-
- Feb 08, 2011
-
-
Peter Eisentraut authored
This adds collation support for columns and domains, a COLLATE clause to override it per expression, and B-tree index support. Peter Eisentraut reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
-
- Feb 01, 2011
-
-
Bruce Momjian authored
-
- Jan 29, 2011
-
-
Bruce Momjian authored
capitalization.
-
- Nov 07, 2010
-
-
Tom Lane authored
PG 8.4 added a built-in feature for casting pretty much any data type to string types (text, varchar, etc). We allowed this to work in any of the historically-allowed syntaxes: CAST(x AS text), x::text, text(x), or x.text. However, multiple complaints have shown that it's too easy to invoke such casts unintentionally in the latter two styles, particularly field selection. To cure the problem with the narrowest possible change of behavior, disallow use of I/O conversion casts from composite types to string types via functional/attribute syntax. The new functionality is still available via cast syntax. In passing, document the equivalence of functional and attribute syntax in a more visible place.
-
- Oct 14, 2010
-
-
Peter Eisentraut authored
-
- Sep 20, 2010
-
-
Magnus Hagander authored
-
- Sep 07, 2010
-
-
Peter Eisentraut authored
-
- Sep 01, 2010
-
-
Tom Lane authored
Per discussion.
-
- Aug 13, 2010
-
-
Robert Haas authored
Thom Brown
-
- Aug 12, 2010
-
-
Bruce Momjian authored
-
- Aug 11, 2010
-
-
Bruce Momjian authored
-
- Aug 05, 2010
-
-
Tom Lane authored
functionality, while creating an ambiguity in usage with ORDER BY that at least two people have already gotten seriously confused by. Also, add an opr_sanity test to check that we don't in future violate the newly minted policy of not having built-in aggregates with the same name and different numbers of parameters. Per discussion of a complaint from Thom Brown.
-
- Aug 04, 2010
-
-
Tom Lane authored
aggregates. People seem to not get this right without help.
-
- Jul 20, 2010
-
-
Robert Haas authored
This change should be publicized to driver maintainers at once and release-noted as an incompatibility with previous releases.
-
- Jul 03, 2010
-
-
Robert Haas authored
Erik Rijkers
-
- Jun 09, 2010
-
-
Alvaro Herrera authored
-
- May 30, 2010
-
-
Tom Lane authored
"val AS name" to "name := val", as per recent discussion. This patch catches everything in the original named-parameters patch, but I'm not certain that no other dependencies snuck in later (grepping the source tree for all uses of AS soon proved unworkable). In passing I note that we've dropped the ball at least once on keeping ecpg's lexer (as opposed to parser) in sync with the backend. It would be a good idea to go through all of pgc.l and see if it's in sync now. I didn't attempt that at the moment.
-
- May 27, 2010
-
-
Peter Eisentraut authored
-
- Apr 03, 2010
-
-
Peter Eisentraut authored
The endterm attribute is mainly useful when the toolchain does not support automatic link target text generation for a particular situation. In the past, this was required by the man page tools for all reference page links, but that is no longer the case, and it now actually gets in the way of proper automatic link text generation. The only remaining use cases are currently xrefs to refsects.
-
- Feb 12, 2010
-
-
Tom Lane authored
This patch allows the frame to start from CURRENT ROW (in either RANGE or ROWS mode), and it also adds support for ROWS n PRECEDING and ROWS n FOLLOWING start and end points. (RANGE value PRECEDING/FOLLOWING isn't there yet --- the grammar works, but that's all.) Hitoshi Harada, reviewed by Pavel Stehule
-
- Feb 04, 2010
-
-
Tom Lane authored
-
- Feb 03, 2010
-
-
Bruce Momjian authored
-
- Dec 15, 2009
-
-
Tom Lane authored
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
-
- Nov 06, 2009
-
-
Tom Lane authored
it works just as well to have them be ordinary identifiers, and this gets rid of a number of ugly special cases. Plus we aren't interfering with non-rule usage of these names. catversion bump because the names change internally in stored rules.
-
- Oct 08, 2009
-
-
Tom Lane authored
match which function parameters. The syntax uses AS, for example funcname(value AS arg1, anothervalue AS arg2) Pavel Stehule
-
- Sep 23, 2009
-
-
Peter Eisentraut authored
Author: Marko Kreen <markokr@gmail.com>
-
- Sep 22, 2009
-
-
Peter Eisentraut authored
This is mainly to make the functionality consistent with the proposed \u escape syntax.
-
- Aug 27, 2009
-
-
Tom Lane authored
so that their elements are always taken as simple expressions over the query's input columns. It originally seemed like a good idea to make them act exactly like GROUP BY and ORDER BY, right down to the SQL92-era behavior of accepting output column names or numbers. However, that was not such a great idea, for two reasons: 1. It permits circular references, as exhibited in bug #5018: the output column could be the one containing the window function itself. (We actually had a regression test case illustrating this, but nobody thought twice about how confusing that would be.) 2. It doesn't seem like a good idea for, eg, "lead(foo) OVER (ORDER BY foo)" to potentially use two completely different meanings for "foo". Accordingly, narrow down the behavior of window clauses to use only the SQL99-compliant interpretation that the expressions are simple expressions.
-