2014-02-19 14:35:23 +01:00
|
|
|
--
|
|
|
|
-- PG_LSN
|
|
|
|
--
|
|
|
|
CREATE TABLE PG_LSN_TBL (f1 pg_lsn);
|
|
|
|
-- Largest and smallest input
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES ('0/0');
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES ('FFFFFFFF/FFFFFFFF');
|
|
|
|
-- Incorrect input
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES ('G/0');
|
2014-02-19 16:06:59 +01:00
|
|
|
ERROR: invalid input syntax for type pg_lsn: "G/0"
|
2014-02-19 14:35:23 +01:00
|
|
|
LINE 1: INSERT INTO PG_LSN_TBL VALUES ('G/0');
|
|
|
|
^
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES ('-1/0');
|
2014-02-19 16:06:59 +01:00
|
|
|
ERROR: invalid input syntax for type pg_lsn: "-1/0"
|
2014-02-19 14:35:23 +01:00
|
|
|
LINE 1: INSERT INTO PG_LSN_TBL VALUES ('-1/0');
|
|
|
|
^
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES (' 0/12345678');
|
2014-02-19 16:06:59 +01:00
|
|
|
ERROR: invalid input syntax for type pg_lsn: " 0/12345678"
|
2014-02-19 14:35:23 +01:00
|
|
|
LINE 1: INSERT INTO PG_LSN_TBL VALUES (' 0/12345678');
|
|
|
|
^
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES ('ABCD/');
|
2014-02-19 16:06:59 +01:00
|
|
|
ERROR: invalid input syntax for type pg_lsn: "ABCD/"
|
2014-02-19 14:35:23 +01:00
|
|
|
LINE 1: INSERT INTO PG_LSN_TBL VALUES ('ABCD/');
|
|
|
|
^
|
|
|
|
INSERT INTO PG_LSN_TBL VALUES ('/ABCD');
|
2014-02-19 16:06:59 +01:00
|
|
|
ERROR: invalid input syntax for type pg_lsn: "/ABCD"
|
2014-02-19 14:35:23 +01:00
|
|
|
LINE 1: INSERT INTO PG_LSN_TBL VALUES ('/ABCD');
|
|
|
|
^
|
|
|
|
DROP TABLE PG_LSN_TBL;
|
|
|
|
-- Operators
|
|
|
|
SELECT '0/16AE7F8' = '0/16AE7F8'::pg_lsn;
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '0/16AE7F8'::pg_lsn != '0/16AE7F7';
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '0/16AE7F7' < '0/16AE7F8'::pg_lsn;
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '0/16AE7F8' > pg_lsn '0/16AE7F7';
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT '0/16AE7F7'::pg_lsn - '0/16AE7F8'::pg_lsn; -- No negative results
|
2014-02-19 15:34:15 +01:00
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
-1
|
|
|
|
(1 row)
|
|
|
|
|
2014-02-19 14:35:23 +01:00
|
|
|
SELECT '0/16AE7F8'::pg_lsn - '0/16AE7F7'::pg_lsn; -- correct
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
1
|
|
|
|
(1 row)
|
|
|
|
|