------------------------------------------------------------------------------+-------+------
PREPARE pgss_test (int) AS SELECT $1, $2 LIMIT $3 | 1 | 1
SELECT $1 +| 4 | 4
- +| |
+ -- multiline +| |
AS "text" | |
SELECT $1 + $2 | 2 | 2
SELECT $1 + $2 + $3 AS "add" | 3 | 3
/*
* Note that the whitespace rule includes both true
* whitespace and single-line ("--" style) comments.
- * We suppress whitespace at the start of the query
- * buffer. We also suppress all single-line comments,
- * which is pretty dubious but is the historical
- * behavior.
+ * We suppress whitespace until we have collected some
+ * non-whitespace data. (This interacts with some
+ * decisions in MainLoop(); see there for details.)
*/
- if (!(output_buf->len == 0 || yytext[0] == '-'))
+ if (output_buf->len > 0)
ECHO;
}
(values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
group by p order by p;
ERROR: sum is not an ordered-set aggregate, so it cannot have WITHIN GROUP
-LINE 1: select p, sum() within group (order by x::float8)
+LINE 1: select p, sum() within group (order by x::float8) -- error
^
select p, percentile_cont(p,p) -- error
from generate_series(1,5) x,
(values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
group by p order by p;
ERROR: WITHIN GROUP is required for ordered-set aggregate percentile_cont
-LINE 1: select p, percentile_cont(p,p)
+LINE 1: select p, percentile_cont(p,p) -- error
^
select percentile_cont(0.5) within group (order by b) from aggtest;
percentile_cont
WHEN (NEW.b < 0) -- error
EXECUTE PROCEDURE gtest_trigger_func();
ERROR: BEFORE trigger's WHEN condition cannot reference NEW generated columns
-LINE 3: WHEN (NEW.b < 0)
+LINE 3: WHEN (NEW.b < 0) -- error
^
DETAIL: Column "b" is a generated column.
CREATE TRIGGER gtest2b BEFORE INSERT OR UPDATE ON gtest26
WHEN (NEW.* IS NOT NULL) -- error
EXECUTE PROCEDURE gtest_trigger_func();
ERROR: BEFORE trigger's WHEN condition cannot reference NEW generated columns
-LINE 3: WHEN (NEW.* IS NOT NULL)
+LINE 3: WHEN (NEW.* IS NOT NULL) -- error
^
DETAIL: A whole-row reference is used and the table contains generated columns.
CREATE TRIGGER gtest2 BEFORE INSERT ON gtest26
)
SELECT * FROM outermost ORDER BY 1;
ERROR: relation "outermost" does not exist
-LINE 4: SELECT * FROM outermost
+LINE 4: SELECT * FROM outermost -- fail
^
DETAIL: There is a WITH item named "outermost", but it cannot be referenced from this part of the query.
HINT: Use WITH RECURSIVE, or re-order the WITH items to remove forward references.
)
SELECT * FROM outermost ORDER BY 1;
ERROR: recursive reference to query "outermost" must not appear within a subquery
-LINE 2: WITH innermost as (SELECT 2 FROM outermost)
+LINE 2: WITH innermost as (SELECT 2 FROM outermost) -- fail
^
--
-- This test will fail with the old implementation of PARAM_EXEC parameter