~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/test/regress/expected/hs_standby_allowed.out

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- Hot Standby tests
 
3
--
 
4
-- hs_standby_allowed.sql
 
5
--
 
6
-- SELECT
 
7
select count(*) as should_be_1 from hs1;
 
8
 should_be_1 
 
9
-------------
 
10
           1
 
11
(1 row)
 
12
 
 
13
select count(*) as should_be_2 from hs2;
 
14
 should_be_2 
 
15
-------------
 
16
           2
 
17
(1 row)
 
18
 
 
19
select count(*) as should_be_3 from hs3;
 
20
 should_be_3 
 
21
-------------
 
22
           3
 
23
(1 row)
 
24
 
 
25
COPY hs1 TO '/tmp/copy_test';
 
26
\! cat /tmp/copy_test
 
27
1
 
28
-- Access sequence directly
 
29
select min_value as sequence_min_value from hsseq;
 
30
 sequence_min_value 
 
31
--------------------
 
32
                  1
 
33
(1 row)
 
34
 
 
35
-- Transactions
 
36
begin;
 
37
select count(*)  as should_be_1 from hs1;
 
38
 should_be_1 
 
39
-------------
 
40
           1
 
41
(1 row)
 
42
 
 
43
end;
 
44
begin transaction read only;
 
45
select count(*)  as should_be_1 from hs1;
 
46
 should_be_1 
 
47
-------------
 
48
           1
 
49
(1 row)
 
50
 
 
51
end;
 
52
begin transaction isolation level serializable;
 
53
select count(*) as should_be_1 from hs1;
 
54
 should_be_1 
 
55
-------------
 
56
           1
 
57
(1 row)
 
58
 
 
59
select count(*) as should_be_1 from hs1;
 
60
 should_be_1 
 
61
-------------
 
62
           1
 
63
(1 row)
 
64
 
 
65
select count(*) as should_be_1 from hs1;
 
66
 should_be_1 
 
67
-------------
 
68
           1
 
69
(1 row)
 
70
 
 
71
commit;
 
72
begin;
 
73
select count(*) as should_be_1 from hs1;
 
74
 should_be_1 
 
75
-------------
 
76
           1
 
77
(1 row)
 
78
 
 
79
commit;
 
80
begin;
 
81
select count(*) as should_be_1 from hs1;
 
82
 should_be_1 
 
83
-------------
 
84
           1
 
85
(1 row)
 
86
 
 
87
abort;
 
88
start transaction;
 
89
select count(*) as should_be_1 from hs1;
 
90
 should_be_1 
 
91
-------------
 
92
           1
 
93
(1 row)
 
94
 
 
95
commit;
 
96
begin;
 
97
select count(*) as should_be_1 from hs1;
 
98
 should_be_1 
 
99
-------------
 
100
           1
 
101
(1 row)
 
102
 
 
103
rollback;
 
104
begin;
 
105
select count(*) as should_be_1 from hs1;
 
106
 should_be_1 
 
107
-------------
 
108
           1
 
109
(1 row)
 
110
 
 
111
savepoint s;
 
112
select count(*) as should_be_2 from hs2;
 
113
 should_be_2 
 
114
-------------
 
115
           2
 
116
(1 row)
 
117
 
 
118
commit;
 
119
begin;
 
120
select count(*) as should_be_1 from hs1;
 
121
 should_be_1 
 
122
-------------
 
123
           1
 
124
(1 row)
 
125
 
 
126
savepoint s;
 
127
select count(*) as should_be_2 from hs2;
 
128
 should_be_2 
 
129
-------------
 
130
           2
 
131
(1 row)
 
132
 
 
133
release savepoint s;
 
134
select count(*) as should_be_2 from hs2;
 
135
 should_be_2 
 
136
-------------
 
137
           2
 
138
(1 row)
 
139
 
 
140
savepoint s;
 
141
select count(*) as should_be_3 from hs3;
 
142
 should_be_3 
 
143
-------------
 
144
           3
 
145
(1 row)
 
146
 
 
147
rollback to savepoint s;
 
148
select count(*) as should_be_2 from hs2;
 
149
 should_be_2 
 
150
-------------
 
151
           2
 
152
(1 row)
 
153
 
 
154
commit;
 
155
-- SET parameters
 
156
-- has no effect on read only transactions, but we can still set it
 
157
set synchronous_commit = on;
 
158
show synchronous_commit;
 
159
 synchronous_commit 
 
160
--------------------
 
161
 on
 
162
(1 row)
 
163
 
 
164
reset synchronous_commit;
 
165
discard temp;
 
166
discard all;
 
167
-- CURSOR commands
 
168
BEGIN;
 
169
DECLARE hsc CURSOR FOR select * from hs3;
 
170
FETCH next from hsc;
 
171
 col1 
 
172
------
 
173
  113
 
174
(1 row)
 
175
 
 
176
fetch first from hsc;
 
177
 col1 
 
178
------
 
179
  113
 
180
(1 row)
 
181
 
 
182
fetch last from hsc;
 
183
 col1 
 
184
------
 
185
  115
 
186
(1 row)
 
187
 
 
188
fetch 1 from hsc;
 
189
 col1 
 
190
------
 
191
(0 rows)
 
192
 
 
193
CLOSE hsc;
 
194
COMMIT;
 
195
-- Prepared plans
 
196
PREPARE hsp AS select count(*) from hs1;
 
197
PREPARE hsp_noexec (integer) AS insert into hs1 values ($1);
 
198
EXECUTE hsp;
 
199
 count 
 
200
-------
 
201
     1
 
202
(1 row)
 
203
 
 
204
DEALLOCATE hsp;
 
205
-- LOCK
 
206
BEGIN;
 
207
LOCK hs1 IN ACCESS SHARE MODE;
 
208
LOCK hs1 IN ROW SHARE MODE;
 
209
LOCK hs1 IN ROW EXCLUSIVE MODE;
 
210
COMMIT;
 
211
-- LOAD
 
212
-- should work, easier if there is no test for that...
 
213
-- ALLOWED COMMANDS
 
214
CHECKPOINT;
 
215
discard all;