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

Error message editing in utils/adt. Again thanks to Joe Conway for doing

the bulk of the heavy lifting ...
This commit is contained in:
Tom Lane
2003-07-27 04:53:12 +00:00
parent 524cfad23f
commit b6a1d25b0a
79 changed files with 2141 additions and 1081 deletions

View File

@@ -28,12 +28,12 @@ INSERT INTO ABSTIME_TBL (f1) VALUES (abstime '-infinity');
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'May 10, 1947 23:59:12');
-- what happens if we specify slightly misformatted abstime?
INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
ERROR: Bad abstime external representation 'Feb 35, 1946 10:00:00'
ERROR: invalid input syntax for abstime: "Feb 35, 1946 10:00:00"
INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
ERROR: Bad abstime external representation 'Feb 28, 1984 25:08:10'
ERROR: invalid input syntax for abstime: "Feb 28, 1984 25:08:10"
-- badly formatted abstimes: these should result in invalid abstimes
INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
ERROR: Bad abstime external representation 'bad date format'
ERROR: invalid input syntax for abstime: "bad date format"
INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
-- test abstime operators
SELECT '' AS eight, ABSTIME_TBL.*;

View File

@@ -28,12 +28,12 @@ INSERT INTO ABSTIME_TBL (f1) VALUES (abstime '-infinity');
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'May 10, 1947 23:59:12');
-- what happens if we specify slightly misformatted abstime?
INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
ERROR: Bad abstime external representation 'Feb 35, 1946 10:00:00'
ERROR: invalid input syntax for abstime: "Feb 35, 1946 10:00:00"
INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
ERROR: Bad abstime external representation 'Feb 28, 1984 25:08:10'
ERROR: invalid input syntax for abstime: "Feb 28, 1984 25:08:10"
-- badly formatted abstimes: these should result in invalid abstimes
INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
ERROR: Bad abstime external representation 'bad date format'
ERROR: invalid input syntax for abstime: "bad date format"
INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
-- test abstime operators
SELECT '' AS eight, ABSTIME_TBL.*;

View File

@@ -709,7 +709,7 @@ select * from def_test;
-- set defaults to an incorrect type: this should fail
alter table def_test alter column c1 set default 'wrong_datatype';
ERROR: pg_atoi: error in "wrong_datatype": can't parse "wrong_datatype"
ERROR: invalid input syntax for 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;

View File

@@ -6,12 +6,12 @@
--
CREATE TABLE BIT_TABLE(b BIT(11));
INSERT INTO BIT_TABLE VALUES (B'10'); -- too short
ERROR: Bit string length 2 does not match type BIT(11)
ERROR: bit string length 2 does not match type bit(11)
INSERT INTO BIT_TABLE VALUES (B'00000000000');
INSERT INTO BIT_TABLE VALUES (B'11011000000');
INSERT INTO BIT_TABLE VALUES (B'01010101010');
INSERT INTO BIT_TABLE VALUES (B'101011111010'); -- too long
ERROR: Bit string length 12 does not match type BIT(11)
ERROR: bit string length 12 does not match type bit(11)
--INSERT INTO BIT_TABLE VALUES ('X554');
--INSERT INTO BIT_TABLE VALUES ('X555');
SELECT * FROM BIT_TABLE;
@@ -28,7 +28,7 @@ INSERT INTO VARBIT_TABLE VALUES (B'0');
INSERT INTO VARBIT_TABLE VALUES (B'010101');
INSERT INTO VARBIT_TABLE VALUES (B'01010101010');
INSERT INTO VARBIT_TABLE VALUES (B'101011111010'); -- too long
ERROR: Bit string too long for type BIT VARYING(11)
ERROR: bit string too long for type bit varying(11)
--INSERT INTO VARBIT_TABLE VALUES ('X554');
--INSERT INTO VARBIT_TABLE VALUES ('X555');
SELECT * FROM VARBIT_TABLE;
@@ -212,11 +212,11 @@ SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table;
DROP TABLE bit_table;
-- The following should fail
select B'001' & B'10';
ERROR: Cannot AND bit strings of different sizes
ERROR: cannot AND bit strings of different sizes
select B'0111' | B'011';
ERROR: Cannot OR bit strings of different sizes
ERROR: cannot OR bit strings of different sizes
select B'0010' # B'011101';
ERROR: Cannot XOR bit strings of different sizes
ERROR: cannot XOR bit strings of different sizes
-- More position tests, checking all the boundary cases
SELECT POSITION(B'1010' IN B'0000101'); -- 0
position

View File

@@ -112,7 +112,7 @@ INSERT INTO BOOLTBL2 (f1) VALUES (bool 'FALSE');
-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
INSERT INTO BOOLTBL2 (f1)
VALUES (bool 'XXX');
ERROR: Bad boolean external representation 'XXX'
ERROR: invalid input syntax for boolean: "XXX"
-- BOOLTBL2 should be full of false's at this point
SELECT '' AS f_4, BOOLTBL2.*;
f_4 | f1

View File

@@ -24,9 +24,9 @@ INSERT INTO BOX_TBL (f1) VALUES ('(2.5, 2.5, 2.5,3.5)');
INSERT INTO BOX_TBL (f1) VALUES ('(3.0, 3.0,3.0,3.0)');
-- badly formatted box inputs
INSERT INTO BOX_TBL (f1) VALUES ('(2.3, 4.5)');
ERROR: Bad box external representation '(2.3, 4.5)'
ERROR: invalid input syntax for box: "(2.3, 4.5)"
INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad');
ERROR: Bad box external representation 'asdfasdf(ad'
ERROR: invalid input syntax for box: "asdfasdf(ad"
SELECT '' AS four, BOX_TBL.*;
four | f1
------+---------------------

View File

@@ -10,11 +10,11 @@ INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
INSERT INTO CIRCLE_TBL VALUES ('<(100,1),115>');
-- bad values
INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>');
ERROR: Bad circle external representation '<(-100,0),-100>'
ERROR: invalid input syntax for circle: "<(-100,0),-100>"
INSERT INTO CIRCLE_TBL VALUES ('1abc,3,5');
ERROR: Bad circle external representation '1abc,3,5'
ERROR: invalid input syntax for circle: "1abc,3,5"
INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)');
ERROR: Bad circle external representation '(3,(1,2),3)'
ERROR: invalid input syntax for circle: "(3,(1,2),3)"
SELECT * FROM CIRCLE_TBL;
f1
----------------

View File

@@ -34,7 +34,7 @@ COPY x (a, b, c, d, e, d, c) from stdin;
ERROR: attribute "d" specified more than once
-- missing data: should fail
COPY x from stdin;
ERROR: pg_atoi: zero-length string
ERROR: invalid input syntax for integer: ""
CONTEXT: COPY FROM, line 1
COPY x from stdin;
ERROR: missing data for column "e"

View File

@@ -10,7 +10,7 @@ INSERT INTO DATE_TBL VALUES ('1996-03-01');
INSERT INTO DATE_TBL VALUES ('1996-03-02');
INSERT INTO DATE_TBL VALUES ('1997-02-28');
INSERT INTO DATE_TBL VALUES ('1997-02-29');
ERROR: Bad date external representation '1997-02-29'
ERROR: invalid input syntax for date: "1997-02-29"
INSERT INTO DATE_TBL VALUES ('1997-03-01');
INSERT INTO DATE_TBL VALUES ('1997-03-02');
INSERT INTO DATE_TBL VALUES ('2000-04-01');

View File

@@ -9,13 +9,13 @@ INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
-- test for over and under flow
INSERT INTO FLOAT4_TBL(f1) VALUES ('10e40');
ERROR: Bad float4 input format -- overflow
ERROR: float4 value out of range: overflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e40');
ERROR: Bad float4 input format -- overflow
ERROR: float4 value out of range: overflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-40');
ERROR: Bad float4 input format -- underflow
ERROR: float4 value out of range: underflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-40');
ERROR: Bad float4 input format -- underflow
ERROR: float4 value out of range: underflow
SELECT '' AS five, FLOAT4_TBL.*;
five | f1
------+--------------

View File

@@ -9,13 +9,13 @@ INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
-- test for over and under flow
INSERT INTO FLOAT4_TBL(f1) VALUES ('10e40');
ERROR: Bad float4 input format -- overflow
ERROR: float4 value out of range: overflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e40');
ERROR: Bad float4 input format -- overflow
ERROR: float4 value out of range: overflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-40');
ERROR: Bad float4 input format -- underflow
ERROR: float4 value out of range: underflow
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-40');
ERROR: Bad float4 input format -- underflow
ERROR: float4 value out of range: underflow
SELECT '' AS five, FLOAT4_TBL.*;
five | f1
------+-------------

View File

@@ -247,15 +247,15 @@ UPDATE FLOAT8_TBL
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: Bad float8 input format -- overflow
ERROR: float8 value out of range: overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero
ERROR: cannot take log of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number
ERROR: cannot take log of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: division by zero
SELECT '' AS five, FLOAT8_TBL.*;
@@ -270,13 +270,13 @@ SELECT '' AS five, FLOAT8_TBL.*;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: Input '10e400' is out of range for float8
ERROR: "10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
ERROR: Input '-10e400' is out of range for float8
ERROR: "-10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
ERROR: Input '10e-400' is out of range for float8
ERROR: "10e-400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
ERROR: Input '-10e-400' is out of range for float8
ERROR: "-10e-400" is out of range for float8
-- maintain external table consistency across platforms
-- delete all values and reinsert well-behaved ones
DELETE FROM FLOAT8_TBL;

View File

@@ -247,15 +247,16 @@ UPDATE FLOAT8_TBL
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: floating point exception! The last floating point operation either exceeded legal ranges or was a divide by zero
ERROR: floating-point exception
DETAIL: An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero.
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero
ERROR: cannot take log of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number
ERROR: cannot take log of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: division by zero
SELECT '' AS five, FLOAT8_TBL.*;
@@ -270,13 +271,13 @@ SELECT '' AS five, FLOAT8_TBL.*;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: Input '10e400' is out of range for float8
ERROR: "10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
ERROR: Input '-10e400' is out of range for float8
ERROR: "-10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
ERROR: Input '10e-400' is out of range for float8
ERROR: "10e-400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
ERROR: Input '-10e-400' is out of range for float8
ERROR: "-10e-400" is out of range for float8
-- maintain external table consistency across platforms
-- delete all values and reinsert well-behaved ones
DELETE FROM FLOAT8_TBL;

View File

@@ -247,15 +247,15 @@ UPDATE FLOAT8_TBL
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: Bad float8 input format -- overflow
ERROR: float8 value out of range: overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero
ERROR: cannot take log of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number
ERROR: cannot take log of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: division by zero
SELECT '' AS five, FLOAT8_TBL.*;
@@ -270,9 +270,9 @@ SELECT '' AS five, FLOAT8_TBL.*;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: Input '10e400' is out of range for float8
ERROR: "10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
ERROR: Input '-10e400' is out of range for float8
ERROR: "-10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
-- maintain external table consistency across platforms

View File

@@ -247,15 +247,15 @@ UPDATE FLOAT8_TBL
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: Bad float8 input format -- overflow
ERROR: float8 value out of range: overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range
ERROR: result is out of range
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero
ERROR: cannot take log of zero
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number
ERROR: cannot take log of a negative number
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range
ERROR: result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: division by zero
SELECT '' AS five, FLOAT8_TBL.*;
@@ -270,13 +270,13 @@ SELECT '' AS five, FLOAT8_TBL.*;
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: Input '10e400' is out of range for float8
ERROR: "10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
ERROR: Input '-10e400' is out of range for float8
ERROR: "-10e400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
ERROR: Input '10e-400' is out of range for float8
ERROR: "10e-400" is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
ERROR: Input '-10e-400' is out of range for float8
ERROR: "-10e-400" is out of range for float8
-- maintain external table consistency across platforms
-- delete all values and reinsert well-behaved ones
DELETE FROM FLOAT8_TBL;

View File

@@ -2350,7 +2350,7 @@ SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
FROM ABSTIME_TBL WHERE NOT isfinite(f1);
ERROR: Unable to convert abstime 'invalid' to timestamp
ERROR: cannot convert "invalid" abstime to timestamp
SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
FROM INTERVAL_TBL;
ten | interval | reltime

View File

@@ -2350,7 +2350,7 @@ SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
FROM ABSTIME_TBL WHERE NOT isfinite(f1);
ERROR: Unable to convert abstime 'invalid' to timestamp
ERROR: cannot convert "invalid" abstime to timestamp
SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
FROM INTERVAL_TBL;
ten | interval | reltime

View File

@@ -2350,7 +2350,7 @@ SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
FROM ABSTIME_TBL WHERE NOT isfinite(f1);
ERROR: Unable to convert abstime 'invalid' to timestamp
ERROR: cannot convert "invalid" abstime to timestamp
SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
FROM INTERVAL_TBL;
ten | interval | reltime

View File

@@ -24,16 +24,19 @@ INSERT INTO INET_TBL (c, i) VALUES ('10:23::8000/113', '10:23::ffff');
INSERT INTO INET_TBL (c, i) VALUES ('::ffff:1.2.3.4', '::4.3.2.1/24');
-- check that CIDR rejects invalid input:
INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/24', '192.168.1.226');
ERROR: invalid CIDR value '192.168.1.2/24': has bits set to right of mask
ERROR: invalid cidr value: "192.168.1.2/24"
DETAIL: Value has bits set to right of mask.
INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4');
ERROR: invalid CIDR value '1234::1234::1234'
ERROR: invalid input syntax for cidr: "1234::1234::1234"
-- check that CIDR rejects invalid input when converting from text:
INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/24'), '192.168.1.226');
ERROR: invalid CIDR value '192.168.1.2/24': has bits set to right of mask
ERROR: invalid cidr value: "192.168.1.2/24"
DETAIL: Value has bits set to right of mask.
INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:ffff::/24'), '::192.168.1.226');
ERROR: invalid CIDR value 'ffff:ffff:ffff:ffff::/24': has bits set to right of mask
ERROR: invalid cidr value: "ffff:ffff:ffff:ffff::/24"
DETAIL: Value has bits set to right of mask.
SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL;
ten | cidr | inet
ten | cidr | inet
-----+--------------------+------------------
| 192.168.1.0/24 | 192.168.1.226/24
| 192.168.1.0/24 | 192.168.1.226
@@ -56,7 +59,7 @@ SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL;
-- now test some support functions
SELECT '' AS ten, i AS inet, host(i), text(i), family(i) FROM INET_TBL;
ten | inet | host | text | family
ten | inet | host | text | family
-----+------------------+---------------+------------------+--------
| 192.168.1.226/24 | 192.168.1.226 | 192.168.1.226/24 | 4
| 192.168.1.226 | 192.168.1.226 | 192.168.1.226/32 | 4
@@ -79,7 +82,7 @@ SELECT '' AS ten, i AS inet, host(i), text(i), family(i) FROM INET_TBL;
SELECT '' AS ten, c AS cidr, broadcast(c),
i AS inet, broadcast(i) FROM INET_TBL;
ten | cidr | broadcast | inet | broadcast
ten | cidr | broadcast | inet | broadcast
-----+--------------------+------------------+------------------+---------------------------------------
| 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.226/24 | 192.168.1.255/24
| 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.226 | 192.168.1.226
@@ -102,7 +105,7 @@ SELECT '' AS ten, c AS cidr, broadcast(c),
SELECT '' AS ten, c AS cidr, network(c) AS "network(cidr)",
i AS inet, network(i) AS "network(inet)" FROM INET_TBL;
ten | cidr | network(cidr) | inet | network(inet)
ten | cidr | network(cidr) | inet | network(inet)
-----+--------------------+--------------------+------------------+------------------
| 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.226/24 | 192.168.1.0/24
| 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.226 | 192.168.1.226/32
@@ -171,7 +174,7 @@ SELECT '' AS ten, i, c,
i << c AS sb, i <<= c AS sbe,
i >> c AS sup, i >>= c AS spe
FROM INET_TBL;
ten | i | c | lt | le | eq | ge | gt | ne | sb | sbe | sup | spe
ten | i | c | lt | le | eq | ge | gt | ne | sb | sbe | sup | spe
-----+------------------+--------------------+----+----+----+----+----+----+----+-----+-----+-----
| 192.168.1.226/24 | 192.168.1.0/24 | f | f | f | t | t | t | f | t | f | t
| 192.168.1.226 | 192.168.1.0/24 | f | f | f | t | t | t | t | t | f | f

View File

@@ -8,15 +8,15 @@ INSERT INTO INT2_TBL(f1) VALUES ('0');
INSERT INTO INT2_TBL(f1) VALUES ('1234');
INSERT INTO INT2_TBL(f1) VALUES ('-1234');
INSERT INTO INT2_TBL(f1) VALUES ('34.5');
ERROR: pg_atoi: error in "34.5": can't parse ".5"
ERROR: invalid input syntax for integer: "34.5"
-- largest and smallest values
INSERT INTO INT2_TBL(f1) VALUES ('32767');
INSERT INTO INT2_TBL(f1) VALUES ('-32767');
-- bad input values -- should give warnings
INSERT INTO INT2_TBL(f1) VALUES ('100000');
ERROR: pg_atoi: error reading "100000": Numerical result out of range
ERROR: 100000 is out of range for int2
INSERT INTO INT2_TBL(f1) VALUES ('asdf');
ERROR: pg_atoi: error in "asdf": can't parse "asdf"
ERROR: invalid input syntax for integer: "asdf"
SELECT '' AS five, INT2_TBL.*;
five | f1
------+--------

View File

@@ -8,15 +8,15 @@ INSERT INTO INT4_TBL(f1) VALUES ('0');
INSERT INTO INT4_TBL(f1) VALUES ('123456');
INSERT INTO INT4_TBL(f1) VALUES ('-123456');
INSERT INTO INT4_TBL(f1) VALUES ('34.5');
ERROR: pg_atoi: error in "34.5": can't parse ".5"
ERROR: invalid input syntax for integer: "34.5"
-- largest and smallest values
INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
-- bad input values -- should give warnings
INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
ERROR: pg_atoi: error reading "1000000000000": Numerical result out of range
ERROR: 1000000000000 is out of range for int4
INSERT INTO INT4_TBL(f1) VALUES ('asdf');
ERROR: pg_atoi: error in "asdf": can't parse "asdf"
ERROR: invalid input syntax for integer: "asdf"
SELECT '' AS five, INT4_TBL.*;
five | f1
------+-------------

View File

@@ -58,9 +58,9 @@ INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
-- badly formatted interval
INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
ERROR: Bad interval external representation 'badly formatted interval'
ERROR: invalid input syntax for interval: "badly formatted interval"
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
ERROR: Bad interval external representation '@ 30 eons ago'
ERROR: invalid input syntax for interval: "@ 30 eons ago"
-- test interval operators
SELECT '' AS ten, INTERVAL_TBL.*;
ten | f1

View File

@@ -11,13 +11,13 @@ INSERT INTO LSEG_TBL VALUES ('[-1e6,2e2,3e5, -4e1]');
INSERT INTO LSEG_TBL VALUES ('(11,22,33,44)');
-- bad values for parser testing
INSERT INTO LSEG_TBL VALUES ('(3asdf,2 ,3,4r2)');
ERROR: Bad lseg external representation '(3asdf,2 ,3,4r2)'
ERROR: invalid input syntax for lseg: "(3asdf,2 ,3,4r2)"
INSERT INTO LSEG_TBL VALUES ('[1,2,3, 4');
ERROR: Bad lseg external representation '[1,2,3, 4'
ERROR: invalid input syntax for lseg: "[1,2,3, 4"
INSERT INTO LSEG_TBL VALUES ('[(,2),(3,4)]');
ERROR: Bad lseg external representation '[(,2),(3,4)]'
ERROR: invalid input syntax for lseg: "[(,2),(3,4)]"
INSERT INTO LSEG_TBL VALUES ('[(1,2),(3,4)');
ERROR: Bad lseg external representation '[(1,2),(3,4)'
ERROR: invalid input syntax for lseg: "[(1,2),(3,4)"
select * from LSEG_TBL;
s
-------------------------------

View File

@@ -675,11 +675,13 @@ CREATE TABLE fract_only (id int, val numeric(4,4));
INSERT INTO fract_only VALUES (1, '0.0');
INSERT INTO fract_only VALUES (2, '0.1');
INSERT INTO fract_only VALUES (3, '1.0'); -- should fail
ERROR: overflow on numeric ABS(value) >= 10^0 for field with precision 4 scale 4
ERROR: numeric field overflow
DETAIL: ABS(value) >= 10^0 for field with precision 4, scale 4.
INSERT INTO fract_only VALUES (4, '-0.9999');
INSERT INTO fract_only VALUES (5, '0.99994');
INSERT INTO fract_only VALUES (6, '0.99995'); -- should fail
ERROR: overflow on numeric ABS(value) >= 10^0 for field with precision 4 scale 4
ERROR: numeric field overflow
DETAIL: ABS(value) >= 10^0 for field with precision 4, scale 4.
INSERT INTO fract_only VALUES (7, '0.00001');
INSERT INTO fract_only VALUES (8, '0.00017');
SELECT * FROM fract_only;

View File

@@ -10,9 +10,9 @@ INSERT INTO OID_TBL(f1) VALUES ('99999999');
INSERT INTO OID_TBL(f1) VALUES ('');
-- bad inputs
INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
ERROR: oidin: error in "asdfasd": can't parse "asdfasd"
ERROR: invalid input syntax for OID: "asdfasd"
INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
ERROR: oidin: error in "99asdfasd": can't parse "asdfasd"
ERROR: invalid input syntax for OID: "99asdfasd"
SELECT '' AS six, OID_TBL.*;
six | f1
-----+------------

View File

@@ -13,9 +13,9 @@ INSERT INTO PATH_TBL VALUES ('[11,12,13,14]');
INSERT INTO PATH_TBL VALUES ('(11,12,13,14)');
-- bad values for parser testing
INSERT INTO PATH_TBL VALUES ('[(,2),(3,4)]');
ERROR: Bad path external representation '[(,2),(3,4)]'
ERROR: invalid input syntax for path: "[(,2),(3,4)]"
INSERT INTO PATH_TBL VALUES ('[(1,2),(3,4)');
ERROR: Bad path external representation '[(1,2),(3,4)'
ERROR: invalid input syntax for path: "[(1,2),(3,4)"
SELECT f1 FROM PATH_TBL;
f1
---------------------------

View File

@@ -9,12 +9,12 @@ INSERT INTO POINT_TBL(f1) VALUES ('(5.1, 34.5)');
INSERT INTO POINT_TBL(f1) VALUES ('(-5.0,-12.0)');
-- bad format points
INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf');
ERROR: Bad point external representation 'asdfasdf'
ERROR: invalid input syntax for point: "asdfasdf"
INSERT INTO POINT_TBL(f1) VALUES ('10.0,10.0');
INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)');
ERROR: Bad point external representation '(10.0 10.0)'
ERROR: invalid input syntax for point: "(10.0 10.0)"
INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0');
ERROR: Bad point external representation '(10.0,10.0'
ERROR: invalid input syntax for point: "(10.0,10.0"
SELECT '' AS six, POINT_TBL.*;
six | f1
-----+------------

View File

@@ -21,15 +21,15 @@ INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,0.0)');
INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,1.0),(0.0,1.0)');
-- bad polygon input strings
INSERT INTO POLYGON_TBL(f1) VALUES ('0.0');
ERROR: Bad polygon external representation '0.0'
ERROR: invalid input syntax for polygon: "0.0"
INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0 0.0');
ERROR: Bad polygon external representation '(0.0 0.0'
ERROR: invalid input syntax for polygon: "(0.0 0.0"
INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2)');
ERROR: Bad polygon external representation '(0,1,2)'
ERROR: invalid input syntax for polygon: "(0,1,2)"
INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2,3');
ERROR: Bad polygon external representation '(0,1,2,3'
ERROR: invalid input syntax for polygon: "(0,1,2,3"
INSERT INTO POLYGON_TBL(f1) VALUES ('asdf');
ERROR: Bad polygon external representation 'asdf'
ERROR: invalid input syntax for polygon: "asdf"
SELECT '' AS four, POLYGON_TBL.*;
four | f1
------+---------------------

View File

@@ -286,7 +286,7 @@ ERROR: relation "pg_shad" does not exist
select has_table_privilege('nosuchuser','pg_shadow','select');
ERROR: user "nosuchuser" does not exist
select has_table_privilege('pg_shadow','sel');
ERROR: has_table_privilege: invalid privilege type sel
ERROR: unrecognized privilege type: "sel"
select has_table_privilege(-999999,'pg_shadow','update');
ERROR: user with ID 4293967297 does not exist
select has_table_privilege(1,'rule');
@@ -561,7 +561,8 @@ SELECT has_table_privilege('regressuser3', 'atest4', 'SELECT'); -- true
(1 row)
REVOKE SELECT ON atest4 FROM regressuser2; -- fail
ERROR: dependent privileges exist (use CASCADE to revoke them too)
ERROR: dependent privileges exist
HINT: Use CASCADE to revoke them too.
REVOKE GRANT OPTION FOR SELECT ON atest4 FROM regressuser2 CASCADE; -- ok
SELECT has_table_privilege('regressuser2', 'atest4', 'SELECT'); -- true
has_table_privilege

View File

@@ -10,9 +10,9 @@ INSERT INTO RELTIME_TBL (f1) VALUES ('@ 3 months');
INSERT INTO RELTIME_TBL (f1) VALUES ('@ 14 seconds ago');
-- badly formatted reltimes
INSERT INTO RELTIME_TBL (f1) VALUES ('badly formatted reltime');
ERROR: Bad reltime external representation 'badly formatted reltime'
ERROR: invalid input syntax for reltime: "badly formatted reltime"
INSERT INTO RELTIME_TBL (f1) VALUES ('@ 30 eons ago');
ERROR: Bad reltime external representation '@ 30 eons ago'
ERROR: invalid input syntax for reltime: "@ 30 eons ago"
-- test reltime operators
SELECT '' AS six, RELTIME_TBL.*;
six | f1

View File

@@ -737,7 +737,7 @@ SELECT replace('yabadoo', 'bad', '') AS "yaoo";
-- test split_part
--
select split_part('joeuser@mydatabase','@',0) AS "an error";
ERROR: field position must be > 0
ERROR: field position must be greater than zero
select split_part('joeuser@mydatabase','@',1) AS "joeuser";
joeuser
---------

View File

@@ -11,7 +11,7 @@ CREATE TABLE TIMESTAMP_TBL ( d1 timestamp(2) without time zone);
-- statements.
INSERT INTO TIMESTAMP_TBL VALUES ('now');
INSERT INTO TIMESTAMP_TBL VALUES ('current');
ERROR: 'CURRENT' is no longer supported
ERROR: "current" is no longer supported
INSERT INTO TIMESTAMP_TBL VALUES ('today');
INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
@@ -60,13 +60,13 @@ INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
-- Obsolete special values
INSERT INTO TIMESTAMP_TBL VALUES ('invalid');
ERROR: TIMESTAMP 'invalid' no longer supported
ERROR: "invalid" is no longer supported
-- Postgres v6.0 standard output format
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
INSERT INTO TIMESTAMP_TBL VALUES ('Invalid Abstime');
ERROR: TIMESTAMP 'Invalid Abstime' no longer supported
ERROR: "Invalid Abstime" is no longer supported
INSERT INTO TIMESTAMP_TBL VALUES ('Undefined Abstime');
ERROR: TIMESTAMP 'Undefined Abstime' no longer supported
ERROR: "Undefined Abstime" is no longer supported
-- Variations on Postgres v6.1 standard output format
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
@@ -126,7 +126,7 @@ INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
ERROR: Bad timestamp external representation 'Feb 29 17:32:01 1997'
ERROR: invalid input syntax for timestamp: "Feb 29 17:32:01 1997"
INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
@@ -136,9 +136,9 @@ INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
-- Currently unsupported syntax and ranges
INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
ERROR: Bad timestamp external representation 'Feb 16 17:32:01 -0097'
ERROR: invalid input syntax for timestamp: "Feb 16 17:32:01 -0097"
INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
ERROR: TIMESTAMP out of range 'Feb 16 17:32:01 5097 BC'
ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
SELECT '' AS "64", d1 FROM TIMESTAMP_TBL;
64 | d1
----+-----------------------------
@@ -1370,7 +1370,7 @@ SELECT '' AS to_timestamp_8, to_timestamp('2000January09Sunday', 'YYYYFMMonthDDF
(1 row)
SELECT '' AS to_timestamp_9, to_timestamp('97/Feb/16', 'YYMonDD');
ERROR: to_timestamp(): bad value for MON/Mon/mon
ERROR: invalid value for MON/Mon/mon
SELECT '' AS to_timestamp_10, to_timestamp('19971116', 'YYYYMMDD');
to_timestamp_10 | to_timestamp
-----------------+------------------------------

View File

@@ -6,7 +6,7 @@ SET australian_timezones = 'off';
CREATE TABLE TIMESTAMPTZ_TBL ( d1 timestamp(2) with time zone);
INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('current');
ERROR: 'CURRENT' is no longer supported
ERROR: "current" is no longer supported
INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
@@ -55,13 +55,13 @@ INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
-- Obsolete special values
INSERT INTO TIMESTAMPTZ_TBL VALUES ('invalid');
ERROR: TIMESTAMP WITH TIME ZONE 'invalid' no longer supported
ERROR: "invalid" is no longer supported
-- Postgres v6.0 standard output format
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Invalid Abstime');
ERROR: TIMESTAMP WITH TIME ZONE 'Invalid Abstime' no longer supported
ERROR: "Invalid Abstime" is no longer supported
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Undefined Abstime');
ERROR: TIMESTAMP WITH TIME ZONE 'Undefined Abstime' no longer supported
ERROR: "Undefined Abstime" is no longer supported
-- Variations on Postgres v6.1 standard output format
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
@@ -121,7 +121,7 @@ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
ERROR: Bad timestamp external representation 'Feb 29 17:32:01 1997'
ERROR: invalid input syntax for timestamp with time zone: "Feb 29 17:32:01 1997"
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
@@ -131,9 +131,9 @@ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
-- Currently unsupported syntax and ranges
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097');
ERROR: Bad timestamp external representation 'Feb 16 17:32:01 -0097'
ERROR: invalid input syntax for timestamp with time zone: "Feb 16 17:32:01 -0097"
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
ERROR: TIMESTAMP WITH TIME ZONE out of range 'Feb 16 17:32:01 5097 BC'
ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
SELECT '' AS "64", d1 FROM TIMESTAMPTZ_TBL;
64 | d1
----+---------------------------------
@@ -1369,7 +1369,7 @@ SELECT '' AS to_timestamp_8, to_timestamp('2000January09Sunday', 'YYYYFMMonthDDF
(1 row)
SELECT '' AS to_timestamp_9, to_timestamp('97/Feb/16', 'YYMonDD');
ERROR: to_timestamp(): bad value for MON/Mon/mon
ERROR: invalid value for MON/Mon/mon
SELECT '' AS to_timestamp_10, to_timestamp('19971116', 'YYYYMMDD');
to_timestamp_10 | to_timestamp
-----------------+------------------------------

View File

@@ -17,10 +17,10 @@ INSERT INTO TINTERVAL_TBL (f1)
-- badly formatted tintervals
INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["bad time specifications" ""]');
ERROR: Bad abstime external representation 'bad time specifications'
ERROR: invalid input syntax for abstime: "bad time specifications"
INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["" "infinity"]');
ERROR: Bad abstime external representation ''
ERROR: invalid input syntax for abstime: ""
-- test tinterval operators
SELECT '' AS five, TINTERVAL_TBL.*;
five | f1

View File

@@ -17,10 +17,10 @@ INSERT INTO TINTERVAL_TBL (f1)
-- badly formatted tintervals
INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["bad time specifications" ""]');
ERROR: Bad abstime external representation 'bad time specifications'
ERROR: invalid input syntax for abstime: "bad time specifications"
INSERT INTO TINTERVAL_TBL (f1)
VALUES ('["" "infinity"]');
ERROR: Bad abstime external representation ''
ERROR: invalid input syntax for abstime: ""
-- test tinterval operators
SELECT '' AS five, TINTERVAL_TBL.*;
five | f1