1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

Some early work on error message editing. Operator-not-found and

function-not-found messages now distinguish the cases no-match and
ambiguous-match, and they follow the style guidelines too.
This commit is contained in:
Tom Lane
2003-07-04 02:51:34 +00:00
parent cdb8a844e6
commit 79fafdf49c
30 changed files with 387 additions and 365 deletions

View File

@@ -340,14 +340,14 @@ CREATE TEMP TABLE FKTABLE (ftest1 inet);
-- This next should fail, because inet=int does not exist
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- This should also fail for the same reason, but here we
-- give the column name
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- This should succeed, even though they are different types
-- because varchar=int does exist
DROP TABLE FKTABLE;
@@ -368,30 +368,30 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' fo
CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: cidr = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
DROP TABLE FKTABLE;
-- Again, so should this...
CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
references pktable(ptest1, ptest2);
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: cidr = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
DROP TABLE FKTABLE;
-- This fails because we mixed up the column ordering
CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
references pktable(ptest2, ptest1);
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'integer' and 'inet'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: integer = inet
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- As does this...
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1)
references pktable(ptest1, ptest2);
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- temp tables should go away by themselves, need not drop them.
-- test check constraint adding
create table atacc1 ( test int );

View File

@@ -111,7 +111,7 @@ create aggregate newavg2 (sfunc = int4pl,
stype = int4,
finalfunc = int2um,
initcond = '0');
ERROR: AggregateCreate: function int2um(integer) does not exist
ERROR: function int2um(integer) does not exist
-- left out basetype
create aggregate newcnt1 (sfunc = int4inc,
stype = int4,
@@ -146,10 +146,10 @@ drop aggregate newcnt (nonesuch);
ERROR: Type "nonesuch" does not exist
-- no such aggregate
drop aggregate nonesuch (int4);
ERROR: RemoveAggregate: aggregate nonesuch(integer) does not exist
ERROR: aggregate nonesuch(integer) does not exist
-- no such aggregate for type
drop aggregate newcnt (float4);
ERROR: RemoveAggregate: aggregate newcnt(real) does not exist
ERROR: aggregate newcnt(real) does not exist
--
-- DROP FUNCTION
@@ -161,7 +161,7 @@ drop function 314159();
ERROR: syntax error at or near "314159" at character 15
-- no such function
drop function nonesuch();
ERROR: RemoveFunction: function nonesuch() does not exist
ERROR: function nonesuch() does not exist
--
-- DROP TYPE
@@ -200,7 +200,7 @@ drop operator === (int4);
ERROR: parser: argument type missing (use NONE for unary operators)
-- no such operator by that name
drop operator === (int4, int4);
ERROR: RemoveOperator: Operator '===' for types 'int4' and 'int4' does not exist
ERROR: operator does not exist: integer === integer
-- no such type1
drop operator = (nonesuch);
ERROR: parser: argument type missing (use NONE for unary operators)
@@ -209,10 +209,10 @@ drop operator = ( , int4);
ERROR: syntax error at or near "," at character 19
-- no such type1
drop operator = (nonesuch, int4);
ERROR: Type "nonesuch" does not exist
ERROR: type nonesuch does not exist
-- no such type2
drop operator = (int4, nonesuch);
ERROR: Type "nonesuch" does not exist
ERROR: type nonesuch does not exist
-- no such type2
drop operator = (int4, );
ERROR: syntax error at or near ")" at character 24

View File

@@ -716,14 +716,14 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' fo
-- This next should fail, because inet=int does not exist
CREATE TABLE FKTABLE (ftest1 inet REFERENCES pktable);
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- This should also fail for the same reason, but here we
-- give the column name
CREATE TABLE FKTABLE (ftest1 inet REFERENCES pktable(ptest1));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- This should succeed, even though they are different types
-- because varchar=int does exist
CREATE TABLE FKTABLE (ftest1 varchar REFERENCES pktable);
@@ -740,28 +740,28 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' fo
-- This should fail, because we just chose really odd types
CREATE TABLE FKTABLE (ftest1 cidr, ftest2 timestamp, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable);
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: cidr = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- Again, so should this...
CREATE TABLE FKTABLE (ftest1 cidr, ftest2 timestamp, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable(ptest1, ptest2));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: cidr = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- This fails because we mixed up the column ordering
CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest2, ftest1) REFERENCES pktable);
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- As does this...
CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest2, ftest1) REFERENCES pktable(ptest1, ptest2));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- And again..
CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest1, ftest2) REFERENCES pktable(ptest2, ptest1));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'integer' and 'inet'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: integer = inet
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- This works...
CREATE TABLE FKTABLE (ftest1 int, ftest2 inet, FOREIGN KEY(ftest2, ftest1) REFERENCES pktable(ptest2, ptest1));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
@@ -789,22 +789,22 @@ CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY
ptest4) REFERENCES pktable(ptest2, ptest1));
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'integer' and 'inet'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: integer = inet
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- Nor should this... (same reason, we have 4,3 referencing 1,2 which mismatches types
CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest4,
ptest3) REFERENCES pktable(ptest1, ptest2));
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- Not this one either... Same as the last one except we didn't defined the columns being referenced.
CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest4,
ptest3) REFERENCES pktable);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
--
-- Now some cases with inheritance
-- Basic 2 table case: 1 column of matching types.
@@ -895,25 +895,25 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' fo
-- just generally bad types (with and without column references on the referenced table)
create table fktable(ftest1 cidr, ftest2 int[], foreign key (ftest1, ftest2) references pktable);
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: cidr = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
create table fktable(ftest1 cidr, ftest2 int[], foreign key (ftest1, ftest2) references pktable(base1, ptest1));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: cidr = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- let's mix up which columns reference which
create table fktable(ftest1 int, ftest2 inet, foreign key(ftest2, ftest1) references pktable);
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
create table fktable(ftest1 int, ftest2 inet, foreign key(ftest2, ftest1) references pktable(base1, ptest1));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
create table fktable(ftest1 int, ftest2 inet, foreign key(ftest1, ftest2) references pktable(ptest1, base1));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'integer' and 'inet'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: integer = inet
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
drop table pktable;
drop table pktable_base;
-- 2 columns (1 table), mismatched types
@@ -922,26 +922,26 @@ create table pktable(ptest1 inet, ptest2 inet[], primary key(base1, ptest1), for
pktable(base1, ptest1)) inherits (pktable_base);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet[]' and 'inet'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet[] = inet
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
create table pktable(ptest1 inet, ptest2 inet, primary key(base1, ptest1), foreign key(base2, ptest2) references
pktable(ptest1, base1)) inherits (pktable_base);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'integer' and 'inet'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: integer = inet
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
create table pktable(ptest1 inet, ptest2 inet, primary key(base1, ptest1), foreign key(ptest2, base2) references
pktable(base1, ptest1)) inherits (pktable_base);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
create table pktable(ptest1 inet, ptest2 inet, primary key(base1, ptest1), foreign key(ptest2, base2) references
pktable(base1, ptest1)) inherits (pktable_base);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: Unable to identify an operator '=' for types 'inet' and 'integer'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: inet = integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
drop table pktable;
ERROR: table "pktable" does not exist
drop table pktable_base;

View File

@@ -104,8 +104,8 @@ SELECT '' AS one, p1.f1
-- intersection
SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
FROM LSEG_TBL l, POINT_TBL p;
ERROR: Unable to identify an operator '#' for types 'lseg' and 'point'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: lseg # point
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- closest point
SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
FROM LSEG_TBL l, POINT_TBL p;

View File

@@ -104,8 +104,8 @@ SELECT '' AS one, p1.f1
-- intersection
SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
FROM LSEG_TBL l, POINT_TBL p;
ERROR: Unable to identify an operator '#' for types 'lseg' and 'point'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: lseg # point
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
-- closest point
SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
FROM LSEG_TBL l, POINT_TBL p;

View File

@@ -299,8 +299,8 @@ SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
(1 row)
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
ERROR: Unable to identify an operator '-' for types 'date' and 'time with time zone'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: date - time with time zone
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
--
-- timestamp, interval arithmetic
--
@@ -332,20 +332,20 @@ SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days'
Feb 23, 285506
----------------------------
Fri Feb 23 00:00:00 285506
(1 row)
(1 row)
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
Jan 20, 288244
----------------------------
Sat Jan 20 00:00:00 288244
(1 row)
(1 row)
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
Dec 31, 294276
----------------------------
Sun Dec 31 00:00:00 294276
(1 row)
(1 row)
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
106751991 Days
------------------

View File

@@ -299,8 +299,8 @@ SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
(1 row)
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
ERROR: Unable to identify an operator '-' for types 'date' and 'time with time zone'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: date - time with time zone
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
--
-- timestamp, interval arithmetic
--
@@ -332,20 +332,20 @@ SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days'
Feb 23, 285506
----------------------------
Fri Feb 23 00:00:00 285506
(1 row)
(1 row)
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
Jan 20, 288244
----------------------------
Sat Jan 20 00:00:00 288244
(1 row)
(1 row)
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
Dec 31, 294276
----------------------------
Sun Dec 31 00:00:00 294276
(1 row)
(1 row)
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
106751991 Days
------------------

View File

@@ -299,8 +299,8 @@ SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
(1 row)
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
ERROR: Unable to identify an operator '-' for types 'date' and 'time with time zone'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: date - time with time zone
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.
--
-- timestamp, interval arithmetic
--
@@ -332,20 +332,20 @@ SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days'
Feb 23, 285506
----------------------------
Fri Feb 23 00:00:00 285506
(1 row)
(1 row)
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
Jan 20, 288244
----------------------------
Sat Jan 20 00:00:00 288244
(1 row)
(1 row)
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
Dec 31, 294276
----------------------------
Sun Dec 31 00:00:00 294276
(1 row)
(1 row)
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
106751991 Days
------------------

View File

@@ -107,7 +107,7 @@ CREATE AGGREGATE myaggp06a(BASETYPE = int, SFUNC = tf2p, STYPE = int[],
-- should ERROR: tfnp(int[], anyelement) not matched by tfnp(int[], int)
CREATE AGGREGATE myaggp07a(BASETYPE = anyelement, SFUNC = tfnp, STYPE = int[],
FINALFUNC = ffp, INITCOND = '{}');
ERROR: AggregateCreate: function tfnp(integer[], anyelement) does not exist
ERROR: function tfnp(integer[], anyelement) does not exist
-- N N P P
-- should CREATE
CREATE AGGREGATE myaggp08a(BASETYPE = anyelement, SFUNC = tf2p, STYPE = int[],
@@ -128,18 +128,18 @@ CREATE AGGREGATE myaggp10b(BASETYPE = int, SFUNC = tfp, STYPE = int[],
-- should ERROR: tf1p(int[],anyelement) not matched by tf1p(anyarray,int)
CREATE AGGREGATE myaggp11a(BASETYPE = anyelement, SFUNC = tf1p, STYPE = int[],
FINALFUNC = ffp, INITCOND = '{}');
ERROR: AggregateCreate: function tf1p(integer[], anyelement) does not exist
ERROR: function tf1p(integer[], anyelement) does not exist
CREATE AGGREGATE myaggp11b(BASETYPE = anyelement, SFUNC = tf1p, STYPE = int[],
INITCOND = '{}');
ERROR: AggregateCreate: function tf1p(integer[], anyelement) does not exist
ERROR: function tf1p(integer[], anyelement) does not exist
-- N P P P
-- should ERROR: tfp(int[],anyelement) not matched by tfp(anyarray,anyelement)
CREATE AGGREGATE myaggp12a(BASETYPE = anyelement, SFUNC = tfp, STYPE = int[],
FINALFUNC = ffp, INITCOND = '{}');
ERROR: AggregateCreate: function tfp(integer[], anyelement) does not exist
ERROR: function tfp(integer[], anyelement) does not exist
CREATE AGGREGATE myaggp12b(BASETYPE = anyelement, SFUNC = tfp, STYPE = int[],
INITCOND = '{}');
ERROR: AggregateCreate: function tfp(integer[], anyelement) does not exist
ERROR: function tfp(integer[], anyelement) does not exist
-- P N N N
-- should ERROR: tfnp(anyarray, int) not matched by tfnp(int[],int)
CREATE AGGREGATE myaggp13a(BASETYPE = int, SFUNC = tfnp, STYPE = anyarray,
@@ -154,12 +154,12 @@ ERROR: an aggregate using ANYARRAY or ANYELEMENT as trans type must also have o
-- should ERROR: tfnp(anyarray, anyelement) not matched by tfnp(int[],int)
CREATE AGGREGATE myaggp15a(BASETYPE = anyelement, SFUNC = tfnp,
STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
ERROR: AggregateCreate: function tfnp(anyarray, anyelement) does not exist
ERROR: function tfnp(anyarray, anyelement) does not exist
-- P N P P
-- should ERROR: tf2p(anyarray, anyelement) not matched by tf2p(int[],anyelement)
CREATE AGGREGATE myaggp16a(BASETYPE = anyelement, SFUNC = tf2p,
STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
ERROR: AggregateCreate: function tf2p(anyarray, anyelement) does not exist
ERROR: function tf2p(anyarray, anyelement) does not exist
-- P P N N
-- should ERROR: we have no way to resolve S
CREATE AGGREGATE myaggp17a(BASETYPE = int, SFUNC = tf1p, STYPE = anyarray,
@@ -180,10 +180,10 @@ ERROR: an aggregate using ANYARRAY or ANYELEMENT as trans type must also have o
-- should ERROR: tf1p(anyarray, anyelement) not matched by tf1p(anyarray, int)
CREATE AGGREGATE myaggp19a(BASETYPE = anyelement, SFUNC = tf1p,
STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
ERROR: AggregateCreate: function tf1p(anyarray, anyelement) does not exist
ERROR: function tf1p(anyarray, anyelement) does not exist
CREATE AGGREGATE myaggp19b(BASETYPE = anyelement, SFUNC = tf1p,
STYPE = anyarray, INITCOND = '{}');
ERROR: AggregateCreate: function tf1p(anyarray, anyelement) does not exist
ERROR: function tf1p(anyarray, anyelement) does not exist
-- P P P P
-- should CREATE
CREATE AGGREGATE myaggp20a(BASETYPE = anyelement, SFUNC = tfp,
@@ -237,10 +237,10 @@ CREATE AGGREGATE myaggn06b(BASETYPE = int, SFUNC = tf2p, STYPE = int[],
-- should ERROR: tfnp(int[], anyelement) not matched by tfnp(int[], int)
CREATE AGGREGATE myaggn07a(BASETYPE = anyelement, SFUNC = tfnp, STYPE = int[],
FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function tfnp(integer[], anyelement) does not exist
ERROR: function tfnp(integer[], anyelement) does not exist
CREATE AGGREGATE myaggn07b(BASETYPE = anyelement, SFUNC = tfnp, STYPE = int[],
INITCOND = '{}');
ERROR: AggregateCreate: function tfnp(integer[], anyelement) does not exist
ERROR: function tfnp(integer[], anyelement) does not exist
-- N N P P
-- should CREATE
CREATE AGGREGATE myaggn08a(BASETYPE = anyelement, SFUNC = tf2p, STYPE = int[],
@@ -259,12 +259,12 @@ CREATE AGGREGATE myaggn10a(BASETYPE = int, SFUNC = tfp, STYPE = int[],
-- should ERROR: tf1p(int[],anyelement) not matched by tf1p(anyarray,int)
CREATE AGGREGATE myaggn11a(BASETYPE = anyelement, SFUNC = tf1p, STYPE = int[],
FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function tf1p(integer[], anyelement) does not exist
ERROR: function tf1p(integer[], anyelement) does not exist
-- N P P P
-- should ERROR: tfp(int[],anyelement) not matched by tfp(anyarray,anyelement)
CREATE AGGREGATE myaggn12a(BASETYPE = anyelement, SFUNC = tfp, STYPE = int[],
FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function tfp(integer[], anyelement) does not exist
ERROR: function tfp(integer[], anyelement) does not exist
-- P N N N
-- should ERROR: tfnp(anyarray, int) not matched by tfnp(int[],int)
CREATE AGGREGATE myaggn13a(BASETYPE = int, SFUNC = tfnp, STYPE = anyarray,
@@ -285,18 +285,18 @@ ERROR: an aggregate using ANYARRAY or ANYELEMENT as trans type must also have o
-- should ERROR: tfnp(anyarray, anyelement) not matched by tfnp(int[],int)
CREATE AGGREGATE myaggn15a(BASETYPE = anyelement, SFUNC = tfnp,
STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function tfnp(anyarray, anyelement) does not exist
ERROR: function tfnp(anyarray, anyelement) does not exist
CREATE AGGREGATE myaggn15b(BASETYPE = anyelement, SFUNC = tfnp,
STYPE = anyarray, INITCOND = '{}');
ERROR: AggregateCreate: function tfnp(anyarray, anyelement) does not exist
ERROR: function tfnp(anyarray, anyelement) does not exist
-- P N P P
-- should ERROR: tf2p(anyarray, anyelement) not matched by tf2p(int[],anyelement)
CREATE AGGREGATE myaggn16a(BASETYPE = anyelement, SFUNC = tf2p,
STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function tf2p(anyarray, anyelement) does not exist
ERROR: function tf2p(anyarray, anyelement) does not exist
CREATE AGGREGATE myaggn16b(BASETYPE = anyelement, SFUNC = tf2p,
STYPE = anyarray, INITCOND = '{}');
ERROR: AggregateCreate: function tf2p(anyarray, anyelement) does not exist
ERROR: function tf2p(anyarray, anyelement) does not exist
-- P P N N
-- should ERROR: ffnp(anyarray) not matched by ffnp(int[])
CREATE AGGREGATE myaggn17a(BASETYPE = int, SFUNC = tf1p, STYPE = anyarray,
@@ -311,12 +311,12 @@ ERROR: an aggregate using ANYARRAY or ANYELEMENT as trans type must also have o
-- should ERROR: tf1p(anyarray, anyelement) not matched by tf1p(anyarray, int)
CREATE AGGREGATE myaggn19a(BASETYPE = anyelement, SFUNC = tf1p,
STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function tf1p(anyarray, anyelement) does not exist
ERROR: function tf1p(anyarray, anyelement) does not exist
-- P P P P
-- should ERROR: ffnp(anyarray) not matched by ffnp(int[])
CREATE AGGREGATE myaggn20a(BASETYPE = anyelement, SFUNC = tfp,
STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
ERROR: AggregateCreate: function ffnp(anyarray) does not exist
ERROR: function ffnp(anyarray) does not exist
-- create test data for polymorphic aggregates
create temp table t(f1 int, f2 int[], f3 text);
insert into t values(1,array[1],'a');

View File

@@ -235,7 +235,7 @@ GRANT USAGE ON FUNCTION testfunc1(int) TO regressuser3; -- semantic error
ERROR: invalid privilege type USAGE for function object
GRANT ALL PRIVILEGES ON FUNCTION testfunc1(int) TO regressuser4;
GRANT ALL PRIVILEGES ON FUNCTION testfunc_nosuch(int) TO regressuser4;
ERROR: GRANT: function testfunc_nosuch(integer) does not exist
ERROR: function testfunc_nosuch(integer) does not exist
CREATE FUNCTION testfunc4(boolean) RETURNS text
AS 'select col1 from atest2 where col2 = $1;'
LANGUAGE sql SECURITY DEFINER;

View File

@@ -69,5 +69,5 @@ SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
-- and do the rest of the testing in horology.sql
-- where we do mixed-type arithmetic. - thomas 2000-12-02
SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
ERROR: Unable to identify an operator '+' for types 'time without time zone' and 'time without time zone'
You will have to retype this query using an explicit cast
ERROR: operator is not unique: time without time zone + time without time zone
HINT: Unable to choose a best candidate operator. You may need to add explicit typecasts.

View File

@@ -76,5 +76,5 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
-- and do the rest of the testing in horology.sql
-- where we do mixed-type arithmetic. - thomas 2000-12-02
SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
ERROR: Unable to identify an operator '+' for types 'time with time zone' and 'time with time zone'
You will have to retype this query using an explicit cast
ERROR: operator does not exist: time with time zone + time with time zone
HINT: No operator matches the given name and argument type(s). You may need to add explicit typecasts.