You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/regress/expected/bfv_meta_track.out
+39-36Lines changed: 39 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -7,58 +7,61 @@ drop schema if exists bfv_meta_track;
7
7
-- end_ignore
8
8
create schema bfv_meta_track;
9
9
set search_path to bfv_meta_track;
10
-
select staactionname, stasubtype, nspname from pg_stat_last_operation join
11
-
pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid
12
-
where pg_namespace.nspname = 'bfv_meta_track';
13
-
staactionname | stasubtype | nspname
14
-
---------------+------------+----------------
15
-
CREATE | SCHEMA | bfv_meta_track
10
+
select count(*) from pg_stat_last_operation p join
11
+
pg_namespace on pg_namespace.oid = p.objid
12
+
where pg_namespace.nspname = 'bfv_meta_track' and p.stasubtype = 'SCHEMA';
13
+
count
14
+
-------
15
+
1
16
16
(1 row)
17
17
18
18
-- test drop popicy
19
19
create table t1(a int);
20
20
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
21
21
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
22
22
create policy p1 on t1 using (a % 2 = 0);
23
-
select staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
24
-
staactionname | stasubtype
25
-
---------------+------------
26
-
CREATE | POLICY
23
+
select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
24
+
where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid and a.stasubtype = 'POLICY';
25
+
count
26
+
-------
27
+
1
27
28
(1 row)
28
29
29
-
-- start_ignore
30
-
select a.xmin as pg_stat_last_operation_xmin, a.xmax as pg_stat_last_operation_xmax,
31
-
b.xmin as pg_policy_xmin, b.xmax as pg_policy_xmax,
32
-
staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
33
-
where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
34
-
35
-
select xmin, xmax, relname from pg_class where oid in (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid ) a) ;
36
-
37
-
-- end_ignore
38
-
select relname from pg_class where oid in (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid ) a) ;
39
-
relname
40
-
---------
41
-
(0 rows)
42
-
43
30
drop policy p1 on t1;
44
-
select staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
45
-
staactionname | stasubtype
46
-
---------------+------------
47
-
(0 rows)
31
+
select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
32
+
where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid and a.stasubtype = 'POLICY';
33
+
count
34
+
-------
35
+
0
36
+
(1 row)
48
37
49
38
--test drop publication
50
39
-- start_ignore
51
40
create publication pub1;
52
41
-- end_ignore
53
-
select staactionname, stasubtype from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1';
54
-
staactionname | stasubtype
55
-
---------------+-------------
56
-
CREATE | PUBLICATION
42
+
select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid
43
+
where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION';
44
+
count
45
+
-------
46
+
1
57
47
(1 row)
58
48
59
49
drop publication pub1;
60
-
select staactionname, stasubtype from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1';
61
-
staactionname | stasubtype
62
-
---------------+------------
63
-
(0 rows)
50
+
select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid
51
+
where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION';
52
+
count
53
+
-------
54
+
0
55
+
(1 row)
56
+
57
+
drop schema bfv_meta_track cascade;
58
+
NOTICE: drop cascades to table t1
59
+
-- test drop schema
60
+
select count(*) from pg_stat_last_operation join
61
+
pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid
select xmin, xmax, relname from pg_class whereoidin (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b onb.oid=a.objidwhereb.polname='p1'andb.polrelid='t1'::regclass::oid ) a) ;
25
-
-- end_ignore
26
-
select relname from pg_class whereoidin (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b onb.oid=a.objidwhereb.polname='p1'andb.polrelid='t1'::regclass::oid ) a) ;
27
-
18
+
selectcount(*) from pg_stat_last_operation a join pg_policy b onb.oid=a.objid
0 commit comments