-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
pg_lsn_mixed
143 lines (111 loc) · 4.81 KB
/
pg_lsn_mixed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# LogicTest: cockroach-go-testserver-upgrade-to-master
statement ok
CREATE TABLE xy (x INT, y INT);
# ----------------------------------------------------------------------
# Test PG_LSN references with all nodes running old binaries.
# ----------------------------------------------------------------------
# Cast to PG_LSN.
statement error pgcode 0A000 unimplemented: this syntax
SELECT 'A01F0/1AAA'::PG_LSN;
# Cast to PG_LSN using the vectorized engine.
statement error pgcode 0A000 unimplemented: this syntax
SELECT 'a01f0/1aaa'::PG_LSN FROM generate_series(1, 100) LIMIT 1;
# Table that references PG_LSN.
statement error pgcode 0A000 unimplemented: this syntax
CREATE TABLE t (x PG_LSN);
# Add a PG_LSN column.
statement error pgcode 0A000 unimplemented: this syntax
ALTER TABLE xy ADD COLUMN curs PG_LSN;
# Alter a column type to PG_LSN.
statement ok
SET enable_experimental_alter_column_type_general=true;
statement error pgcode 0A000 unimplemented: this syntax
ALTER TABLE xy ALTER COLUMN y TYPE PG_LSN;
# Create a partial index that uses the PG_LSN type.
statement error pgcode 0A000 unimplemented: this syntax
CREATE INDEX part ON xy (x) WHERE y::PG_LSN < 'a01f0/1aaa';
# Add a check constraint that uses the PG_LSN type.
statement error pgcode 0A000 unimplemented: this syntax
ALTER TABLE xy ADD CONSTRAINT bar CHECK (y::PG_LSN < 'fffff100/100');
# UDT that references PG_LSN.
statement error pgcode 0A000 unimplemented: this syntax
CREATE TYPE typ AS (x INT, y PG_LSN);
# Function that returns PG_LSN.
statement error pgcode 0A000 unimplemented: this syntax
CREATE OR REPLACE FUNCTION f() RETURNS PG_LSN AS $$
SELECT 'a01f0/1aaa';
$$ LANGUAGE SQL;
# Function that takes PG_LSN argument.
statement error pgcode 0A000 unimplemented: this syntax
CREATE OR REPLACE FUNCTION f(curs PG_LSN) RETURNS STRING AS $$
SELECT curs;
$$ LANGUAGE SQL;
# Function that references PG_LSN internally.
statement error pgcode 0A000 unimplemented: this syntax
CREATE OR REPLACE FUNCTION f() RETURNS INT AS $$
SELECT 'a01f0/1aaa'::PG_LSN;
SELECT 0;
$$ LANGUAGE SQL;
# Function that returns a composite type with PG_LSN component.
statement error pgcode 0A000 unimplemented: this syntax
CREATE FUNCTION f() RETURNS RECORD AS $$
SELECT (1, 'a01f0/1aaa'::PG_LSN, true);
$$ LANGUAGE SQL;
# ----------------------------------------------------------------------
# Verify that PG_LSN is not allowed after upgrading the gateway.
# ----------------------------------------------------------------------
upgrade 0
user root nodeidx=0
# Cast to PG_LSN.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
SELECT 'a01f0/1aaa'::PG_LSN;
# Cast to PG_LSN using the vectorized engine.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
SELECT 'a01f0/1aaa'::PG_LSN FROM generate_series(1, 100) LIMIT 1;
# Table that references PG_LSN.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE TABLE t (x PG_LSN);
# Add a PG_LSN column.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
ALTER TABLE xy ADD COLUMN curs PG_LSN;
# Alter a column type to PG_LSN.
statement ok
SET enable_experimental_alter_column_type_general=true;
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
ALTER TABLE xy ALTER COLUMN y TYPE PG_LSN;
# Create a partial index that uses the PG_LSN type.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE INDEX part ON xy (x) WHERE y::PG_LSN < 'a01f0/1aaa';
# Add a check constraint that uses the PG_LSN type.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
ALTER TABLE xy ADD CONSTRAINT bar CHECK (y::PG_LSN < 'fffff100/100');
# UDT that references PG_LSN.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE TYPE typ AS (x INT, y PG_LSN);
# Function that returns PG_LSN.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE OR REPLACE FUNCTION f() RETURNS PG_LSN AS $$
SELECT 'a01f0/1aaa';
$$ LANGUAGE SQL;
# Function that takes PG_LSN argument.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE OR REPLACE FUNCTION f(curs PG_LSN) RETURNS INT AS $$
SELECT 0;
$$ LANGUAGE SQL;
# Function that references PG_LSN internally.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE OR REPLACE FUNCTION f() RETURNS INT AS $$
SELECT 'a01f0/1aaa'::PG_LSN;
SELECT 0;
$$ LANGUAGE SQL;
# Function that returns a composite type with PG_LSN component.
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE FUNCTION f() RETURNS RECORD AS $$
SELECT (1, 'a01f0/1aaa'::PG_LSN, true);
$$ LANGUAGE SQL;
statement error pgcode 0A000 pq: pg_lsn not supported until version 23.2
CREATE FUNCTION f() RETURNS RECORD AS $$
BEGIN
RETURN (1, 'a01f0/1aaa'::PG_LSN, true);
END
$$ LANGUAGE PLpgSQL;