@@ -143,14 +143,14 @@ DROP TABLE tbl;
143143 */
144144CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 int);
145145CREATE 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
152152ALTER 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 */
164164CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box);
165165CREATE 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
172172ALTER 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 */
184184CREATE 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
191191ALTER 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
197197ALTER 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;
207207CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDING(c3,c4));
208208INSERT INTO tbl select x, 2*x, 3*x, box('4,4,4,4') from generate_series(1,1000) as x;
209209CREATE 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
217217DROP TABLE tbl;
218218/*
219219 * 5. REINDEX
220220 */
221221CREATE 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
228228ALTER 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
234234REINDEX INDEX tbl_c1_c2_c3_c4_key;
235235ERROR: 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
241241ALTER 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)
0 commit comments