diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/regress/expected/macaddr.out | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/src/test/regress/expected/macaddr.out b/src/test/regress/expected/macaddr.out new file mode 100644 index 0000000..8d5b221 --- /dev/null +++ b/src/test/regress/expected/macaddr.out @@ -0,0 +1,185 @@ +-- +-- macaddr +-- +CREATE TABLE macaddr_data (a int, b macaddr); +INSERT INTO macaddr_data VALUES (1, '08:00:2b:01:02:03'); +INSERT INTO macaddr_data VALUES (2, '08-00-2b-01-02-03'); +INSERT INTO macaddr_data VALUES (3, '08002b:010203'); +INSERT INTO macaddr_data VALUES (4, '08002b-010203'); +INSERT INTO macaddr_data VALUES (5, '0800.2b01.0203'); +INSERT INTO macaddr_data VALUES (6, '0800-2b01-0203'); +INSERT INTO macaddr_data VALUES (7, '08002b010203'); +INSERT INTO macaddr_data VALUES (8, '0800:2b01:0203'); -- invalid +ERROR: invalid input syntax for type macaddr: "0800:2b01:0203" +LINE 1: INSERT INTO macaddr_data VALUES (8, '0800:2b01:0203'); + ^ +INSERT INTO macaddr_data VALUES (9, 'not even close'); -- invalid +ERROR: invalid input syntax for type macaddr: "not even close" +LINE 1: INSERT INTO macaddr_data VALUES (9, 'not even close'); + ^ +INSERT INTO macaddr_data VALUES (10, '08:00:2b:01:02:04'); +INSERT INTO macaddr_data VALUES (11, '08:00:2b:01:02:02'); +INSERT INTO macaddr_data VALUES (12, '08:00:2a:01:02:03'); +INSERT INTO macaddr_data VALUES (13, '08:00:2c:01:02:03'); +INSERT INTO macaddr_data VALUES (14, '08:00:2a:01:02:04'); +SELECT * FROM macaddr_data; + a | b +----+------------------- + 1 | 08:00:2b:01:02:03 + 2 | 08:00:2b:01:02:03 + 3 | 08:00:2b:01:02:03 + 4 | 08:00:2b:01:02:03 + 5 | 08:00:2b:01:02:03 + 6 | 08:00:2b:01:02:03 + 7 | 08:00:2b:01:02:03 + 10 | 08:00:2b:01:02:04 + 11 | 08:00:2b:01:02:02 + 12 | 08:00:2a:01:02:03 + 13 | 08:00:2c:01:02:03 + 14 | 08:00:2a:01:02:04 +(12 rows) + +CREATE INDEX macaddr_data_btree ON macaddr_data USING btree (b); +CREATE INDEX macaddr_data_hash ON macaddr_data USING hash (b); +SELECT a, b, trunc(b) FROM macaddr_data ORDER BY 2, 1; + a | b | trunc +----+-------------------+------------------- + 12 | 08:00:2a:01:02:03 | 08:00:2a:00:00:00 + 14 | 08:00:2a:01:02:04 | 08:00:2a:00:00:00 + 11 | 08:00:2b:01:02:02 | 08:00:2b:00:00:00 + 1 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 2 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 3 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 4 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 5 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 6 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 7 | 08:00:2b:01:02:03 | 08:00:2b:00:00:00 + 10 | 08:00:2b:01:02:04 | 08:00:2b:00:00:00 + 13 | 08:00:2c:01:02:03 | 08:00:2c:00:00:00 +(12 rows) + +SELECT b < '08:00:2b:01:02:04' FROM macaddr_data WHERE a = 1; -- true + ?column? +---------- + t +(1 row) + +SELECT b > '08:00:2b:01:02:04' FROM macaddr_data WHERE a = 1; -- false + ?column? +---------- + f +(1 row) + +SELECT b > '08:00:2b:01:02:03' FROM macaddr_data WHERE a = 1; -- false + ?column? +---------- + f +(1 row) + +SELECT b <= '08:00:2b:01:02:04' FROM macaddr_data WHERE a = 1; -- true + ?column? +---------- + t +(1 row) + +SELECT b >= '08:00:2b:01:02:04' FROM macaddr_data WHERE a = 1; -- false + ?column? +---------- + f +(1 row) + +SELECT b = '08:00:2b:01:02:03' FROM macaddr_data WHERE a = 1; -- true + ?column? +---------- + t +(1 row) + +SELECT b <> '08:00:2b:01:02:04' FROM macaddr_data WHERE a = 1; -- true + ?column? +---------- + t +(1 row) + +SELECT b <> '08:00:2b:01:02:03' FROM macaddr_data WHERE a = 1; -- false + ?column? +---------- + f +(1 row) + +SELECT ~b FROM macaddr_data; + ?column? +------------------- + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fc + f7:ff:d4:fe:fd:fb + f7:ff:d4:fe:fd:fd + f7:ff:d5:fe:fd:fc + f7:ff:d3:fe:fd:fc + f7:ff:d5:fe:fd:fb +(12 rows) + +SELECT b & '00:00:00:ff:ff:ff' FROM macaddr_data; + ?column? +------------------- + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:04 + 00:00:00:01:02:02 + 00:00:00:01:02:03 + 00:00:00:01:02:03 + 00:00:00:01:02:04 +(12 rows) + +SELECT b | '01:02:03:04:05:06' FROM macaddr_data; + ?column? +------------------- + 09:02:2b:05:07:07 + 09:02:2b:05:07:07 + 09:02:2b:05:07:07 + 09:02:2b:05:07:07 + 09:02:2b:05:07:07 + 09:02:2b:05:07:07 + 09:02:2b:05:07:07 + 09:02:2b:05:07:06 + 09:02:2b:05:07:06 + 09:02:2b:05:07:07 + 09:02:2f:05:07:07 + 09:02:2b:05:07:06 +(12 rows) + +DROP TABLE macaddr_data; +-- test non-error-throwing API for some core types +SELECT pg_input_is_valid('08:00:2b:01:02:ZZ', 'macaddr'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('08:00:2b:01:02:ZZ', 'macaddr'); + message | detail | hint | sql_error_code +------------------------------------------------------------+--------+------+---------------- + invalid input syntax for type macaddr: "08:00:2b:01:02:ZZ" | | | 22P02 +(1 row) + +SELECT pg_input_is_valid('08:00:2b:01:02:', 'macaddr'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('08:00:2b:01:02:', 'macaddr'); + message | detail | hint | sql_error_code +----------------------------------------------------------+--------+------+---------------- + invalid input syntax for type macaddr: "08:00:2b:01:02:" | | | 22P02 +(1 row) + |