提交 2f9bf9bd 编写于 作者: H Heikki Linnakangas

Fix wording of error messages: "You may need ..." -> "You might need ...".

This was done in the upstream earlier already, in commit 8b4ff8b6, but there
were a few GPDB-added error messages left. Fix those too, for consistency.
上级 c0818034
......@@ -4220,8 +4220,7 @@ static Node* grouped_window_mutator(Node *node, void *context)
ereport(ERROR,
(errcode(ERRCODE_WINDOWING_ERROR),
errmsg("unresolved grouping key in window query"),
errhint("You may need to use explicit aliases and/or to refer to grouping "
"keys in the same way throughout the query.")));
errhint("You might need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.")));
}
else
{
......
......@@ -2389,7 +2389,7 @@ transformPercentileExpr(ParseState *pstate, PercentileExpr *p)
errmsg("function \"%s\" does not exist",
percentileFuncString(p, &argtype, 1, NULL, 0)),
errhint("No function matches the given name and argument types. "
"You may need to add explicit type casts.")));
"You might need to add explicit type casts.")));
}
argtype = FLOAT8OID;
......@@ -2523,7 +2523,7 @@ transformPercentileExpr(ParseState *pstate, PercentileExpr *p)
errmsg("function \"%s\" is not unique",
percentileFuncString(p, &argtype, 1, sorttypes, sortlen)),
errhint("Could not choose a best candidate function. "
"You may need to add explicit type casts.")));
"You might need to add explicit type casts.")));
}
else if (ncandidates == 0)
{
......@@ -2532,7 +2532,7 @@ transformPercentileExpr(ParseState *pstate, PercentileExpr *p)
errmsg("function \"%s\" does not exist",
percentileFuncString(p, &argtype, 1, sorttypes, sortlen)),
errhint("No function matches the given name and argument types. "
"You may need to add explicit type casts.")));
"You might need to add explicit type casts.")));
}
p->perctype = candidates->args[0];
......
......@@ -345,7 +345,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
errmsg("function %s() does not exist",
NameListToString(funcname)),
errhint("No function matches the given name and argument types. "
"You may need to add explicit type casts."),
"You might need to add explicit type casts."),
parser_errposition(pstate, location)));
}
......
......@@ -708,25 +708,25 @@ select array_agg(distinct a,b,c order by i)
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,b,c order by i)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select array_agg(distinct a,b,c order by a,b+1)
from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,b,c order by a,b+1)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select array_agg(distinct a,b,c order by a,b,i,c)
from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,b,c order by a,b,i,c)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select array_agg(distinct a,a,c order by a,b)
from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,a,c order by a,b)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- string_agg tests
select string_agg(a) from (values('aaaa'),('bbbb'),('cccc')) g(a);
string_agg
......@@ -798,12 +798,12 @@ SELECT a(aggtest order by a) from aggtest; -- function-like column reference
ERROR: function a(aggtest) does not exist
LINE 1: SELECT a(aggtest order by a) from aggtest;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT nosuchagg(a order by a) FROM aggtest; -- no such function
ERROR: function nosuchagg(smallint) does not exist
LINE 1: SELECT nosuchagg(a order by a) FROM aggtest;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT lag(a order by a) from aggtest; -- window function (no window clause)
ERROR: ORDER BY specified, but lag is not an ordered aggregate function
LINE 1: SELECT lag(a order by a) from aggtest;
......
......@@ -714,25 +714,25 @@ select array_agg(distinct a,b,c order by i)
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,b,c order by i)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select array_agg(distinct a,b,c order by a,b+1)
from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,b,c order by a,b+1)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select array_agg(distinct a,b,c order by a,b,i,c)
from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,b,c order by a,b,i,c)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select array_agg(distinct a,a,c order by a,b)
from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
ERROR: function array_agg(integer, integer, text) does not exist
LINE 1: select array_agg(distinct a,a,c order by a,b)
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- string_agg tests
select string_agg(a) from (values('aaaa'),('bbbb'),('cccc')) g(a);
string_agg
......@@ -804,12 +804,12 @@ SELECT a(aggtest order by a) from aggtest; -- function-like column reference
ERROR: function a(aggtest) does not exist
LINE 1: SELECT a(aggtest order by a) from aggtest;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT nosuchagg(a order by a) FROM aggtest; -- no such function
ERROR: function nosuchagg(smallint) does not exist
LINE 1: SELECT nosuchagg(a order by a) FROM aggtest;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT lag(a order by a) from aggtest; -- window function (no window clause)
ERROR: ORDER BY specified, but lag is not an ordered aggregate function
LINE 1: SELECT lag(a order by a) from aggtest;
......
......@@ -899,7 +899,7 @@ select decode(true, false);
ERROR: function decode(boolean, boolean) does not exist
LINE 1: select decode(true, false);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select decode(2);
ERROR: syntax error at or near ")"
LINE 1: select decode(2);
......
......@@ -26,7 +26,7 @@ select dfunc(10, 20, 30); -- fail
ERROR: function dfunc(integer, integer, integer) does not exist
LINE 1: select dfunc(10, 20, 30);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
drop function dfunc(); -- fail
ERROR: function dfunc() does not exist
drop function dfunc(int); -- fail
......@@ -93,7 +93,7 @@ select dfunc(); -- fail: which dfunc should be called? int or text
ERROR: function dfunc() is not unique
LINE 1: select dfunc();
^
HINT: Could not choose a best candidate function. You may need to add explicit type casts.
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
select dfunc('Hi'); -- ok
dfunc
-----------
......@@ -136,17 +136,17 @@ select dfunc(); -- fail
ERROR: function dfunc() is not unique
LINE 1: select dfunc();
^
HINT: Could not choose a best candidate function. You may need to add explicit type casts.
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
select dfunc(1); -- fail
ERROR: function dfunc(integer) is not unique
LINE 1: select dfunc(1);
^
HINT: Could not choose a best candidate function. You may need to add explicit type casts.
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
select dfunc(1, 2); -- fail
ERROR: function dfunc(integer, integer) is not unique
LINE 1: select dfunc(1, 2);
^
HINT: Could not choose a best candidate function. You may need to add explicit type casts.
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
select dfunc(1, 2, 3); -- ok
dfunc
-------
......@@ -199,7 +199,7 @@ select dfunc(); -- fail
ERROR: function dfunc() does not exist
LINE 1: select dfunc();
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select dfunc(10);
dfunc
-------
......
......@@ -118,12 +118,12 @@ SELECT max(*) FROM filter_test;
ERROR: function max() does not exist
LINE 1: SELECT max(*) FROM filter_test;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT max(*) FILTER (WHERE i < 5) FROM filter_test;
ERROR: function max() does not exist
LINE 1: SELECT max(*) FILTER (WHERE i < 5) FROM filter_test;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Use old sort implementation
set gp_enable_mk_sort=off;
--- TEST MAX(i)
......@@ -445,7 +445,7 @@ FROM filter_test ORDER BY j, i;
ERROR: function row_number(integer) does not exist
LINE 1: select i, j, row_number() filter (WHERE i % 2 = 1) over (par...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select i, rank() over (order by i) from filter_test ORDER BY i;
i | rank
----+------
......@@ -465,7 +465,7 @@ select i, rank() filter (where true) over (order by i) from filter_test ORDER BY
ERROR: function rank(integer) does not exist
LINE 1: select i, rank() filter (where true) over (order by i) from ...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select i, ntile(3) over (order by i) from filter_test ORDER BY i;
i | ntile
----+-------
......@@ -546,19 +546,19 @@ select i(t) filter (where true) from (select maketuple() as t) x order by i(t);
ERROR: function i(filter_test) does not exist
LINE 1: select i(t) filter (where true) from (select maketuple() as ...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
drop function maketuple();
--- TEST non-exsistant function => same error
select chocolate(i) from filter_test;
ERROR: function chocolate(integer) does not exist
LINE 1: select chocolate(i) from filter_test;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select chocolate(i) filter (where true) from filter_test;
ERROR: function chocolate(integer) does not exist
LINE 1: select chocolate(i) filter (where true) from filter_test;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
--- TEST filter from outside scope => error
select * from (select i from filter_test where j = 1) x1,
(select sum(i) filter (where i < x1.i) from filter_test where j = 2) x2;
......
......@@ -8162,7 +8162,7 @@ group by
2*b.g,
lower(f);
ERROR: unresolved grouping key in window query
HINT: You may need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
HINT: You might need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
-- End MPP-12082
-- MPP-13802
select lag(x) over (w)
......
......@@ -8162,7 +8162,7 @@ group by
2*b.g,
lower(f);
ERROR: unresolved grouping key in window query
HINT: You may need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
HINT: You might need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
-- End MPP-12082
-- MPP-13802
select lag(x) over (w)
......
......@@ -8016,7 +8016,7 @@ group by
2*b.g,
lower(f);
ERROR: unresolved grouping key in window query
HINT: You may need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
HINT: You might need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
-- End MPP-12082
-- MPP-12913
select count(*) over (partition by 1 order by cn rows between 1 preceding and 1 preceding) from sale;
......
......@@ -8022,7 +8022,7 @@ group by
2*b.g,
lower(f);
ERROR: unresolved grouping key in window query
HINT: You may need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
HINT: You might need to use explicit aliases and/or to refer to grouping keys in the same way throughout the query.
-- End MPP-12082
-- MPP-12913
select count(*) over (partition by 1 order by cn rows between 1 preceding and 1 preceding) from sale;
......
......@@ -1079,17 +1079,17 @@ select median('text') from perct;
ERROR: function "median(unknown)" is not unique
LINE 1: select median('text') from perct;
^
HINT: Could not choose a best candidate function. You may need to add explicit type casts.
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
select percentile_cont(now()) within group (order by a) from percts;
ERROR: function "percentile_cont(timestamp with time zone)" does not exist
LINE 1: select percentile_cont(now()) within group (order by a) from...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select percentile_cont(0.5) within group (order by point(0,0)) from perct;
ERROR: function "percentile_cont(double precision) ORDER BY (point)" does not exist
LINE 1: ...elect percentile_cont(0.5) within group (order by point(0,0)...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- outer reference is not allowed for now
select (select a from perct where median(t.a) = 5) from perct t;
ERROR: percentile functions cannot reference columns from outer queries
......
......@@ -393,7 +393,7 @@ select linear_interpolate(5, 0, 'y0'::text, 100, 'y1'::text);
ERROR: function linear_interpolate(integer, integer, text, integer, text) does not exist
LINE 1: select linear_interpolate(5, 0, 'y0'::text, 100, 'y1'::text)...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Check that "divide by zero" returns null
select linear_interpolate('2010-01-03T02:00:00'::timestamp, '2010-01-02T09:20:00'::timestamp, 2000::int4, '2010-01-02T09:20:00'::timestamp, 2250::int4);
linear_interpolate
......
......@@ -31,7 +31,7 @@ select myleast(); -- fail
ERROR: function myleast() does not exist
LINE 1: select myleast();
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- test with variadic call parameter
select myleast(variadic array[1,2,3,4,-1]);
myleast
......@@ -92,7 +92,7 @@ create view print_name as select concat(' ',id, fname, lname) from people; -- fa
ERROR: function concat(unknown, integer, character varying, character varying) does not exist
LINE 1: create view print_name as select concat(' ',id, fname, lname...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
create view print_name as select concat(' ', fname, lname) from people where id < 790;
select * from print_name;
concat
......@@ -138,17 +138,17 @@ select formarray(1.1, array[1.2,55.5]); -- fail without variadic
ERROR: function formarray(numeric, numeric[]) does not exist
LINE 1: select formarray(1.1, array[1.2,55.5]);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select formarray(1, 'x'::text); -- fail, type mismatch
ERROR: function formarray(integer, text) does not exist
LINE 1: select formarray(1, 'x'::text);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
select formarray(1, variadic array['x'::text]); -- fail, type mismatch
ERROR: function formarray(integer, text[]) does not exist
LINE 1: select formarray(1, variadic array['x'::text]);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
drop function formarray(anyelement, variadic anyarray);
-- PLPGSQL
-- test variadic functions
......
......@@ -316,12 +316,12 @@ SELECT scalar_1(TABLE(select 1)); -- TableValue expression does not match type
ERROR: function scalar_1(anytable) does not exist
LINE 1: SELECT scalar_1(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT scalar_5(TABLE(select 1)); -- TableValue shouldn't match "anyelement"
ERROR: function scalar_5(anytable) does not exist
LINE 1: SELECT scalar_5(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Normal scalar input / table output functions
-- begin equivalent */
SELECT row(a+5, b)::example from example;
......@@ -746,12 +746,12 @@ SELECT scalar_tf_1(TABLE(select 1)); -- TableValue expression does not match ty
ERROR: function scalar_tf_1(anytable) does not exist
LINE 1: SELECT scalar_tf_1(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT scalar_tf_6(TABLE(select 1)); -- TableValue expression does not anyelement
ERROR: function scalar_tf_6(anytable) does not exist
LINE 1: SELECT scalar_tf_6(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Table Functions table input / table output
-- begin equivalent
SELECT * FROM example order by a, b;
......@@ -1363,7 +1363,7 @@ SELECT * from nameres(TABLE(SELECT 5)); -- should fail
ERROR: function nameres(anytable) does not exist
LINE 1: SELECT * from nameres(TABLE(SELECT 5));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
CREATE FUNCTION nameres(anytable) RETURNS int
AS '@abs_srcdir@/regress.so', 'multiset_scalar_value' LANGUAGE C READS SQL DATA;
SELECT * from nameres(5); -- should work
......@@ -1383,7 +1383,7 @@ SELECT * from nameres(5); -- should fail
ERROR: function nameres(integer) does not exist
LINE 1: SELECT * from nameres(5);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT * from nameres(TABLE(SELECT 5)); -- should work
nameres
---------
......@@ -1395,12 +1395,12 @@ SELECT * from nameres(5); -- should fail
ERROR: function nameres(integer) does not exist
LINE 1: SELECT * from nameres(5);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT * from nameres(TABLE(SELECT 5)); -- should fail
ERROR: function nameres(anytable) does not exist
LINE 1: SELECT * from nameres(TABLE(SELECT 5));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Error: anytable does NOT match anyelement
CREATE FUNCTION nameres(anyelement) returns int
AS $$ SELECT $1 $$ LANGUAGE SQL CONTAINS SQL;
......@@ -1408,7 +1408,7 @@ SELECT * FROM nameres( TABLE( SELECT 1) ); -- should fail
ERROR: function nameres(anytable) does not exist
LINE 1: SELECT * FROM nameres( TABLE( SELECT 1) );
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
DROP FUNCTION nameres(anyelement);
-- Must support resjunk scatter by clauses
explain SELECT * FROM multiset_5( TABLE( SELECT * FROM example SCATTER BY a+1) );
......@@ -2046,7 +2046,7 @@ SELECT multiset_2( (SELECT a from example) ); -- not a TableValue expressi
ERROR: function multiset_2(integer) does not exist
LINE 1: SELECT multiset_2( (SELECT a from example) );
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT multiset_2( TABLE(SELECT * from example) ); -- not in the from clause
ERROR: table functions must be invoked in FROM clause
SELECT multiset_3( TABLE(SELECT a from example) ); -- not in the from clause
......@@ -2878,12 +2878,12 @@ SELECT extract(day from id) FROM project( TABLE( SELECT * FROM history ), 1);
ERROR: function pg_catalog.date_part(unknown, integer) does not exist
LINE 1: SELECT extract(day from id) FROM project( TABLE( SELECT * FR...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT "time"+1 FROM project( TABLE( SELECT * FROM history ), 2);
ERROR: operator does not exist: timestamp without time zone + integer
LINE 1: SELECT "time"+1 FROM project( TABLE( SELECT * FROM history )...
^
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
-- ERROR: select columns projected out by the function
SELECT id FROM project( TABLE( SELECT * FROM history ), 2);
ERROR: column "id" does not exist
......@@ -3074,7 +3074,7 @@ PREPARE p2 AS SELECT * FROM multiset_2( $1 ) order by a, b;
ERROR: function multiset_2(unknown) does not exist
LINE 1: PREPARE p2 AS SELECT * FROM multiset_2( $1 ) order by a, b;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
PREPARE p3(anytable) AS SELECT * FROM multiset_5( $1 ) order by a, b;
ERROR: type "anytable" is not a valid parameter for PREPARE
-- FAIL: $1 is not a constant
......
......@@ -317,12 +317,12 @@ SELECT scalar_1(TABLE(select 1)); -- TableValue expression does not match type
ERROR: function scalar_1(anytable) does not exist
LINE 1: SELECT scalar_1(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT scalar_5(TABLE(select 1)); -- TableValue shouldn't match "anyelement"
ERROR: function scalar_5(anytable) does not exist
LINE 1: SELECT scalar_5(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Normal scalar input / table output functions
-- begin equivalent */
SELECT row(a+5, b)::example from example;
......@@ -747,12 +747,12 @@ SELECT scalar_tf_1(TABLE(select 1)); -- TableValue expression does not match ty
ERROR: function scalar_tf_1(anytable) does not exist
LINE 1: SELECT scalar_tf_1(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT scalar_tf_6(TABLE(select 1)); -- TableValue expression does not anyelement
ERROR: function scalar_tf_6(anytable) does not exist
LINE 1: SELECT scalar_tf_6(TABLE(select 1));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Table Functions table input / table output
-- begin equivalent
SELECT * FROM example order by a, b;
......@@ -1364,7 +1364,7 @@ SELECT * from nameres(TABLE(SELECT 5)); -- should fail
ERROR: function nameres(anytable) does not exist
LINE 1: SELECT * from nameres(TABLE(SELECT 5));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
CREATE FUNCTION nameres(anytable) RETURNS int
AS '@abs_srcdir@/regress.so', 'multiset_scalar_value' LANGUAGE C READS SQL DATA;
SELECT * from nameres(5); -- should work
......@@ -1384,7 +1384,7 @@ SELECT * from nameres(5); -- should fail
ERROR: function nameres(integer) does not exist
LINE 1: SELECT * from nameres(5);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT * from nameres(TABLE(SELECT 5)); -- should work
nameres
---------
......@@ -1396,12 +1396,12 @@ SELECT * from nameres(5); -- should fail
ERROR: function nameres(integer) does not exist
LINE 1: SELECT * from nameres(5);
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT * from nameres(TABLE(SELECT 5)); -- should fail
ERROR: function nameres(anytable) does not exist
LINE 1: SELECT * from nameres(TABLE(SELECT 5));
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Error: anytable does NOT match anyelement
CREATE FUNCTION nameres(anyelement) returns int
AS $$ SELECT $1 $$ LANGUAGE SQL CONTAINS SQL;
......@@ -1409,7 +1409,7 @@ SELECT * FROM nameres( TABLE( SELECT 1) ); -- should fail
ERROR: function nameres(anytable) does not exist
LINE 1: SELECT * FROM nameres( TABLE( SELECT 1) );
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
DROP FUNCTION nameres(anyelement);
-- Must support resjunk scatter by clauses
explain SELECT * FROM multiset_5( TABLE( SELECT * FROM example SCATTER BY a+1) );
......@@ -2047,7 +2047,7 @@ SELECT multiset_2( (SELECT a from example) ); -- not a TableValue expressi
ERROR: function multiset_2(integer) does not exist
LINE 1: SELECT multiset_2( (SELECT a from example) );
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT multiset_2( TABLE(SELECT * from example) ); -- not in the from clause
ERROR: table functions must be invoked in FROM clause
SELECT multiset_3( TABLE(SELECT a from example) ); -- not in the from clause
......@@ -2879,12 +2879,12 @@ SELECT extract(day from id) FROM project( TABLE( SELECT * FROM history ), 1);
ERROR: function pg_catalog.date_part(unknown, integer) does not exist
LINE 1: SELECT extract(day from id) FROM project( TABLE( SELECT * FR...
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT "time"+1 FROM project( TABLE( SELECT * FROM history ), 2);
ERROR: operator does not exist: timestamp without time zone + integer
LINE 1: SELECT "time"+1 FROM project( TABLE( SELECT * FROM history )...
^
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
-- ERROR: select columns projected out by the function
SELECT id FROM project( TABLE( SELECT * FROM history ), 2);
ERROR: column "id" does not exist
......@@ -3075,7 +3075,7 @@ PREPARE p2 AS SELECT * FROM multiset_2( $1 ) order by a, b;
ERROR: function multiset_2(unknown) does not exist
LINE 1: PREPARE p2 AS SELECT * FROM multiset_2( $1 ) order by a, b;
^
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
PREPARE p3(anytable) AS SELECT * FROM multiset_5( $1 ) order by a, b;
ERROR: type "anytable" is not a valid parameter for PREPARE
-- FAIL: $1 is not a constant
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册