Skip to content

Commit 690c543

Browse files
committed
Fix unstable regression test output.
Output order from the pg_indexes view might vary depending on the phase of the moon, so add ORDER BY to ensure stable results of tests added by commit 386e3d7. Per buildfarm.
1 parent 7c7d4fd commit 690c543

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/test/regress/expected/index_including.out

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ DROP TABLE tbl;
143143
*/
144144
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 int);
145145
CREATE UNIQUE INDEX tbl_idx ON tbl using btree(c1, c2, c3, c4);
146-
select indexdef from pg_indexes where tablename='tbl';
146+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
147147
indexdef
148148
-----------------------------------------------------------------
149149
CREATE UNIQUE INDEX tbl_idx ON tbl USING btree (c1, c2, c3, c4)
150150
(1 row)
151151

152152
ALTER TABLE tbl DROP COLUMN c3;
153-
select indexdef from pg_indexes where tablename='tbl';
153+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
154154
indexdef
155155
----------
156156
(0 rows)
@@ -163,14 +163,14 @@ DROP TABLE tbl;
163163
*/
164164
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box);
165165
CREATE UNIQUE INDEX tbl_idx ON tbl using btree(c1, c2) INCLUDING(c3,c4);
166-
select indexdef from pg_indexes where tablename='tbl';
166+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
167167
indexdef
168168
----------------------------------------------------------------------------
169169
CREATE UNIQUE INDEX tbl_idx ON tbl USING btree (c1, c2) INCLUDING (c3, c4)
170170
(1 row)
171171

172172
ALTER TABLE tbl DROP COLUMN c3;
173-
select indexdef from pg_indexes where tablename='tbl';
173+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
174174
indexdef
175175
----------
176176
(0 rows)
@@ -182,20 +182,20 @@ DROP TABLE tbl;
182182
* as well as key columns deletion. It's explained in documentation.
183183
*/
184184
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
185-
select indexdef from pg_indexes where tablename='tbl';
185+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
186186
indexdef
187187
----------------------------------------------------------------------------------------
188188
CREATE UNIQUE INDEX tbl_c1_c2_c3_c4_key ON tbl USING btree (c1, c2) INCLUDING (c3, c4)
189189
(1 row)
190190

191191
ALTER TABLE tbl DROP COLUMN c3;
192-
select indexdef from pg_indexes where tablename='tbl';
192+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
193193
indexdef
194194
----------
195195
(0 rows)
196196

197197
ALTER TABLE tbl DROP COLUMN c1;
198-
select indexdef from pg_indexes where tablename='tbl';
198+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
199199
indexdef
200200
----------
201201
(0 rows)
@@ -207,39 +207,39 @@ DROP TABLE tbl;
207207
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
208208
INSERT INTO tbl select x, 2*x, 3*x, box('4,4,4,4') from generate_series(1,1000) as x;
209209
CREATE UNIQUE INDEX CONCURRENTLY on tbl (c1, c2) INCLUDING (c3, c4);
210-
select indexdef from pg_indexes where tablename='tbl';
210+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
211211
indexdef
212212
----------------------------------------------------------------------------------------
213-
CREATE UNIQUE INDEX tbl_c1_c2_c3_c4_key ON tbl USING btree (c1, c2) INCLUDING (c3, c4)
214213
CREATE UNIQUE INDEX tbl_c1_c2_c3_c4_idx ON tbl USING btree (c1, c2) INCLUDING (c3, c4)
214+
CREATE UNIQUE INDEX tbl_c1_c2_c3_c4_key ON tbl USING btree (c1, c2) INCLUDING (c3, c4)
215215
(2 rows)
216216

217217
DROP TABLE tbl;
218218
/*
219219
* 5. REINDEX
220220
*/
221221
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
222-
select indexdef from pg_indexes where tablename='tbl';
222+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
223223
indexdef
224224
----------------------------------------------------------------------------------------
225225
CREATE UNIQUE INDEX tbl_c1_c2_c3_c4_key ON tbl USING btree (c1, c2) INCLUDING (c3, c4)
226226
(1 row)
227227

228228
ALTER TABLE tbl DROP COLUMN c3;
229-
select indexdef from pg_indexes where tablename='tbl';
229+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
230230
indexdef
231231
----------
232232
(0 rows)
233233

234234
REINDEX INDEX tbl_c1_c2_c3_c4_key;
235235
ERROR: relation "tbl_c1_c2_c3_c4_key" does not exist
236-
select indexdef from pg_indexes where tablename='tbl';
236+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
237237
indexdef
238238
----------
239239
(0 rows)
240240

241241
ALTER TABLE tbl DROP COLUMN c1;
242-
select indexdef from pg_indexes where tablename='tbl';
242+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
243243
indexdef
244244
----------
245245
(0 rows)

src/test/regress/sql/index_including.sql

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ DROP TABLE tbl;
8888
*/
8989
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 int);
9090
CREATE UNIQUE INDEX tbl_idx ON tbl using btree(c1, c2, c3, c4);
91-
select indexdef from pg_indexes where tablename='tbl';
91+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
9292
ALTER TABLE tbl DROP COLUMN c3;
93-
select indexdef from pg_indexes where tablename='tbl';
93+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
9494
DROP TABLE tbl;
9595

9696
/*
@@ -100,9 +100,9 @@ DROP TABLE tbl;
100100
*/
101101
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box);
102102
CREATE UNIQUE INDEX tbl_idx ON tbl using btree(c1, c2) INCLUDING(c3,c4);
103-
select indexdef from pg_indexes where tablename='tbl';
103+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
104104
ALTER TABLE tbl DROP COLUMN c3;
105-
select indexdef from pg_indexes where tablename='tbl';
105+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
106106
DROP TABLE tbl;
107107

108108
/*
@@ -111,11 +111,11 @@ DROP TABLE tbl;
111111
* as well as key columns deletion. It's explained in documentation.
112112
*/
113113
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
114-
select indexdef from pg_indexes where tablename='tbl';
114+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
115115
ALTER TABLE tbl DROP COLUMN c3;
116-
select indexdef from pg_indexes where tablename='tbl';
116+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
117117
ALTER TABLE tbl DROP COLUMN c1;
118-
select indexdef from pg_indexes where tablename='tbl';
118+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
119119
DROP TABLE tbl;
120120

121121

@@ -125,21 +125,21 @@ DROP TABLE tbl;
125125
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
126126
INSERT INTO tbl select x, 2*x, 3*x, box('4,4,4,4') from generate_series(1,1000) as x;
127127
CREATE UNIQUE INDEX CONCURRENTLY on tbl (c1, c2) INCLUDING (c3, c4);
128-
select indexdef from pg_indexes where tablename='tbl';
128+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
129129
DROP TABLE tbl;
130130

131131

132132
/*
133133
* 5. REINDEX
134134
*/
135135
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
136-
select indexdef from pg_indexes where tablename='tbl';
136+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
137137
ALTER TABLE tbl DROP COLUMN c3;
138-
select indexdef from pg_indexes where tablename='tbl';
138+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
139139
REINDEX INDEX tbl_c1_c2_c3_c4_key;
140-
select indexdef from pg_indexes where tablename='tbl';
140+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
141141
ALTER TABLE tbl DROP COLUMN c1;
142-
select indexdef from pg_indexes where tablename='tbl';
142+
select indexdef from pg_indexes where tablename = 'tbl' order by indexname;
143143
DROP TABLE tbl;
144144

145145
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy