forked from orioledb/orioledb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruncate.out
112 lines (104 loc) · 3.5 KB
/
truncate.out
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
CREATE SCHEMA truncate;
SET SESSION search_path = 'truncate';
CREATE EXTENSION orioledb;
CREATE VIEW o_relnames AS
SELECT c.relname FROM (
SELECT reloid, relnode FROM orioledb_table_oids()
UNION
SELECT index_reloid, index_relnode FROM orioledb_index_oids()) ot
JOIN pg_class c ON c.oid = ot.reloid
WHERE c.relfilenode = ot.relnode
ORDER BY relname;
CREATE TABLE o_non_transactional_truncate (
a int UNIQUE,
b char
) USING orioledb;
BEGIN;
SELECT * FROM o_relnames WHERE relname LIKE 'o_non_transactional_truncate%';
relname
------------------------------------
o_non_transactional_truncate
o_non_transactional_truncate_a_key
(2 rows)
INSERT INTO o_non_transactional_truncate VALUES (3, 'b');
TRUNCATE o_non_transactional_truncate;
SELECT * FROM o_relnames WHERE relname LIKE 'o_non_transactional_truncate%';
relname
------------------------------------
o_non_transactional_truncate
o_non_transactional_truncate_a_key
(2 rows)
COMMIT;
BEGIN;
CREATE TABLE o_transactional_truncate (
a int UNIQUE,
b char
) USING orioledb;
SELECT * FROM o_relnames WHERE relname LIKE 'o_transactional_truncate%';
relname
--------------------------------
o_transactional_truncate
o_transactional_truncate_a_key
(2 rows)
INSERT INTO o_transactional_truncate VALUES (3, 'b');
TRUNCATE o_transactional_truncate;
SELECT * FROM o_relnames WHERE relname LIKE 'o_transactional_truncate%';
relname
--------------------------------
o_transactional_truncate
o_transactional_truncate_a_key
(2 rows)
COMMIT;
CREATE TABLE o_non_transactional_truncate_pkey (
a int PRIMARY KEY,
b char UNIQUE
) USING orioledb;
BEGIN;
SELECT * FROM o_relnames WHERE relname LIKE 'o_non_transactional_truncate_pkey%';
relname
-----------------------------------------
o_non_transactional_truncate_pkey
o_non_transactional_truncate_pkey_b_key
o_non_transactional_truncate_pkey_pkey
(3 rows)
INSERT INTO o_non_transactional_truncate VALUES (3, 'b');
TRUNCATE o_non_transactional_truncate;
SELECT * FROM o_relnames WHERE relname LIKE 'o_non_transactional_truncate_pkey%';
relname
-----------------------------------------
o_non_transactional_truncate_pkey
o_non_transactional_truncate_pkey_b_key
o_non_transactional_truncate_pkey_pkey
(3 rows)
COMMIT;
BEGIN;
CREATE TABLE o_transactional_truncate_pkey (
a int PRIMARY KEY,
b char UNIQUE
) USING orioledb;
SELECT * FROM o_relnames WHERE relname LIKE 'o_transactional_truncate_pkey%';
relname
-------------------------------------
o_transactional_truncate_pkey
o_transactional_truncate_pkey_b_key
o_transactional_truncate_pkey_pkey
(3 rows)
INSERT INTO o_transactional_truncate_pkey VALUES (3, 'b');
TRUNCATE o_transactional_truncate_pkey;
SELECT * FROM o_relnames WHERE relname LIKE 'o_transactional_truncate_pkey%';
relname
-------------------------------------
o_transactional_truncate_pkey
o_transactional_truncate_pkey_b_key
o_transactional_truncate_pkey_pkey
(3 rows)
COMMIT;
DROP EXTENSION orioledb CASCADE;
NOTICE: drop cascades to 5 other objects
DETAIL: drop cascades to table o_non_transactional_truncate
drop cascades to table o_transactional_truncate
drop cascades to table o_non_transactional_truncate_pkey
drop cascades to table o_transactional_truncate_pkey
drop cascades to view o_relnames
DROP SCHEMA truncate CASCADE;
RESET search_path;