SELECT *
FROM dblink_fetch('myconn','error_cursor', 1) AS t(i int);
-ERROR: invalid input syntax for integer: "not an int"
+ERROR: invalid input syntax for type integer: "not an int"
-- Make sure that the local settings have retained their values in spite
-- of shenanigans on the connection.
SHOW datestyle;
-- ===================================================================
ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE int;
SELECT * FROM ft1 WHERE c1 = 1; -- ERROR
-ERROR: invalid input syntax for integer: "foo"
+ERROR: invalid input syntax for type integer: "foo"
CONTEXT: column "c8" of foreign table "ft1"
SELECT ft1.c1, ft2.c2, ft1.c8 FROM ft1, ft2 WHERE ft1.c1 = ft2.c1 AND ft1.c1 = 1; -- ERROR
-ERROR: invalid input syntax for integer: "foo"
+ERROR: invalid input syntax for type integer: "foo"
CONTEXT: column "c8" of foreign table "ft1"
SELECT ft1.c1, ft2.c2, ft1 FROM ft1, ft2 WHERE ft1.c1 = ft2.c1 AND ft1.c1 = 1; -- ERROR
-ERROR: invalid input syntax for integer: "foo"
+ERROR: invalid input syntax for type integer: "foo"
CONTEXT: whole-row reference to foreign table "ft1"
SELECT sum(c2), array_agg(c8) FROM ft1 GROUP BY c8; -- ERROR
-ERROR: invalid input syntax for integer: "foo"
+ERROR: invalid input syntax for type integer: "foo"
CONTEXT: processing expression at position 2 in select list
ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE user_enum;
-- ===================================================================
if (sscanf(str, " ( %lf , %lf )", &x, &y) != 2)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for complex: \"%s\"",
- str)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "complex", str)));
result = (Complex *) palloc(sizeof(Complex));
result->x = x;
if (!errorOK)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for integer: \"%s\"",
- str)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "bigint", str)));
return false;
}
if (*s == 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for integer: \"%s\"",
- s)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "integer", s)));
errno = 0;
l = strtol(s, &badp, 10);
if (s == badp)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for integer: \"%s\"",
- s)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "integer", s)));
switch (size)
{
if (*badp && *badp != c)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for integer: \"%s\"",
- s)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "integer", s)));
return (int32) l;
}
if (isdigit((unsigned char) *tzname))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("invalid input syntax for numeric time zone: \"%s\"",
- tzname),
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "numeric time zone", tzname),
errhint("Numeric time zones must have \"-\" or \"+\" as first character.")));
rt = DecodeTimezone(tzname, &tz);
TRUNCATE subtransaction_tbl;
SELECT subtransaction_test('SPI');
-ERROR: spiexceptions.InvalidTextRepresentation: invalid input syntax for integer: "oops"
+ERROR: spiexceptions.InvalidTextRepresentation: invalid input syntax for type integer: "oops"
LINE 1: INSERT INTO subtransaction_tbl VALUES ('oops')
^
QUERY: INSERT INTO subtransaction_tbl VALUES ('oops')
TRUNCATE subtransaction_tbl;
SELECT subtransaction_ctx_test('SPI');
-ERROR: spiexceptions.InvalidTextRepresentation: invalid input syntax for integer: "oops"
+ERROR: spiexceptions.InvalidTextRepresentation: invalid input syntax for type integer: "oops"
LINE 1: INSERT INTO subtransaction_tbl VALUES ('oops')
^
QUERY: INSERT INTO subtransaction_tbl VALUES ('oops')
return [123, 'abc']
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_array_mixed2();
-ERROR: invalid input syntax for integer: "abc"
+ERROR: invalid input syntax for type integer: "abc"
CONTEXT: while creating return value
PL/Python function "test_type_conversion_array_mixed2"
CREATE FUNCTION test_type_conversion_mdarray_malformed() RETURNS int[] AS $$
TRUNCATE subtransaction_tbl;
SELECT pltcl_wrapper('SELECT subtransaction_ctx_test(''SPI'')');
- pltcl_wrapper
--------------------------------------------------
- ERROR: invalid input syntax for integer: "oops"
+ pltcl_wrapper
+------------------------------------------------------
+ ERROR: invalid input syntax for type integer: "oops"
(1 row)
SELECT * FROM subtransaction_tbl;
^
HINT: To use the hypothetical-set aggregate rank, the number of hypothetical direct arguments (here 1) must match the number of ordering columns (here 2).
select rank('fred') within group (order by x) from generate_series(1,5) x;
-ERROR: invalid input syntax for integer: "fred"
+ERROR: invalid input syntax for type integer: "fred"
LINE 1: select rank('fred') within group (order by x) from generate_...
^
select rank('adam'::text collate "C") within group (order by x collate "POSIX")
-- set defaults to an incorrect type: this should fail
alter table def_test alter column c1 set default 'wrong_datatype';
-ERROR: invalid input syntax for integer: "wrong_datatype"
+ERROR: invalid input syntax for type integer: "wrong_datatype"
alter table def_test alter column c2 set default 20;
-- set defaults on a non-existent column: this should fail
alter table def_test alter column c3 set default 30;
ERROR: column "d" specified more than once
-- missing data: should fail
COPY x from stdin;
-ERROR: invalid input syntax for integer: ""
+ERROR: invalid input syntax for type integer: ""
CONTEXT: COPY x, line 1, column a: ""
COPY x from stdin;
ERROR: missing data for column "e"
INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
INSERT INTO INT2_TBL(f1) VALUES (' -1234');
INSERT INTO INT2_TBL(f1) VALUES ('34.5');
-ERROR: invalid input syntax for integer: "34.5"
+ERROR: invalid input syntax for type integer: "34.5"
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
^
-- largest and smallest values
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('100000');
^
INSERT INTO INT2_TBL(f1) VALUES ('asdf');
-ERROR: invalid input syntax for integer: "asdf"
+ERROR: invalid input syntax for type integer: "asdf"
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
^
INSERT INTO INT2_TBL(f1) VALUES (' ');
-ERROR: invalid input syntax for integer: " "
+ERROR: invalid input syntax for type integer: " "
LINE 1: INSERT INTO INT2_TBL(f1) VALUES (' ');
^
INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
-ERROR: invalid input syntax for integer: "- 1234"
+ERROR: invalid input syntax for type integer: "- 1234"
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
^
INSERT INTO INT2_TBL(f1) VALUES ('4 444');
-ERROR: invalid input syntax for integer: "4 444"
+ERROR: invalid input syntax for type integer: "4 444"
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('4 444');
^
INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
-ERROR: invalid input syntax for integer: "123 dt"
+ERROR: invalid input syntax for type integer: "123 dt"
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
^
INSERT INTO INT2_TBL(f1) VALUES ('');
-ERROR: invalid input syntax for integer: ""
+ERROR: invalid input syntax for type integer: ""
LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('');
^
SELECT '' AS five, * FROM INT2_TBL;
INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
INSERT INTO INT4_TBL(f1) VALUES (' -123456');
INSERT INTO INT4_TBL(f1) VALUES ('34.5');
-ERROR: invalid input syntax for integer: "34.5"
+ERROR: invalid input syntax for type integer: "34.5"
LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
^
-- largest and smallest values
LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
^
INSERT INTO INT4_TBL(f1) VALUES ('asdf');
-ERROR: invalid input syntax for integer: "asdf"
+ERROR: invalid input syntax for type integer: "asdf"
LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
^
INSERT INTO INT4_TBL(f1) VALUES (' ');
-ERROR: invalid input syntax for integer: " "
+ERROR: invalid input syntax for type integer: " "
LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' ');
^
INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
-ERROR: invalid input syntax for integer: " asdf "
+ERROR: invalid input syntax for type integer: " asdf "
LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
^
INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
-ERROR: invalid input syntax for integer: "- 1234"
+ERROR: invalid input syntax for type integer: "- 1234"
LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
^
INSERT INTO INT4_TBL(f1) VALUES ('123 5');
-ERROR: invalid input syntax for integer: "123 5"
+ERROR: invalid input syntax for type integer: "123 5"
LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('123 5');
^
INSERT INTO INT4_TBL(f1) VALUES ('');
-ERROR: invalid input syntax for integer: ""
+ERROR: invalid input syntax for type integer: ""
LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('');
^
SELECT '' AS five, * FROM INT4_TBL;
INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
-- bad inputs
INSERT INTO INT8_TBL(q1) VALUES (' ');
-ERROR: invalid input syntax for integer: " "
+ERROR: invalid input syntax for type bigint: " "
LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' ');
^
INSERT INTO INT8_TBL(q1) VALUES ('xxx');
-ERROR: invalid input syntax for integer: "xxx"
+ERROR: invalid input syntax for type bigint: "xxx"
LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('xxx');
^
INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340...
^
INSERT INTO INT8_TBL(q1) VALUES ('- 123');
-ERROR: invalid input syntax for integer: "- 123"
+ERROR: invalid input syntax for type bigint: "- 123"
LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('- 123');
^
INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
-ERROR: invalid input syntax for integer: " 345 5"
+ERROR: invalid input syntax for type bigint: " 345 5"
LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
^
INSERT INTO INT8_TBL(q1) VALUES ('');
-ERROR: invalid input syntax for integer: ""
+ERROR: invalid input syntax for type bigint: ""
LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('');
^
SELECT * FROM INT8_TBL;
end;
$$ language plpgsql;
select compos();
-ERROR: invalid input syntax for integer: "(1,hello)"
+ERROR: invalid input syntax for type integer: "(1,hello)"
CONTEXT: PL/pgSQL function compos() while casting return value to function's return type
-- test: invalid use of composite expression in scalar-returning function
create or replace function compos() returns int as $$
end;
$$ language plpgsql;
select compos();
-ERROR: invalid input syntax for integer: "(1,hello)"
+ERROR: invalid input syntax for type integer: "(1,hello)"
CONTEXT: PL/pgSQL function compos() while casting return value to function's return type
drop function compos();
drop type compostype;
SAVEPOINT settings;
SET LOCAL force_parallel_mode = 1;
select stringu1::int2 from tenk1 where unique1 = 1;
-ERROR: invalid input syntax for integer: "BAAAAA"
+ERROR: invalid input syntax for type integer: "BAAAAA"
CONTEXT: parallel worker
ROLLBACK TO SAVEPOINT settings;
-- test interaction with set-returning functions
-- these should fail
SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '2');
-ERROR: invalid input syntax for numeric time zone: "2"
+ERROR: invalid input syntax for type numeric time zone: "2"
HINT: Numeric time zones must have "-" or "+" as first character.
SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
ERROR: numeric time zone "+16" out of range
if (i < NARGS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for type widget: \"%s\"",
- str)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "widget", str)));
result = (WIDGET *) palloc(sizeof(WIDGET));
result->center.x = atof(coord[0]);
if (sscanf(str, " ( %lf , %lf )", &x, &y) != 2)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for complex: \"%s\"",
- str)));
+ errmsg("invalid input syntax for type %s: \"%s\"",
+ "complex", str)));
result = (Complex *) palloc(sizeof(Complex));
result->x = x;