Skip to content

Commit b804c15

Browse files
committed
Fix existing 'tablespace' regression test so it passes again.
Changes to repack_indexdef() had broken this test.
1 parent f3fa2fa commit b804c15

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib/repack.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,10 @@ repack_get_order_by(PG_FUNCTION_ARGS)
663663
*
664664
* repack_indexdef(index, table)
665665
*
666-
* @param index Oid of target index.
667-
* @param table Oid of table of the index.
666+
* @param index Oid of target index.
667+
* @param table Oid of table of the index.
668668
* @param tablespace Namespace for the index. If NULL keep the original.
669+
* @param boolean Whether to use CONCURRENTLY when creating the index.
669670
* @retval Create index DDL for temp table.
670671
*/
671672
Datum
@@ -690,7 +691,7 @@ repack_indexdef(PG_FUNCTION_ARGS)
690691
parse_indexdef(&stmt, index, table);
691692

692693
initStringInfo(&str);
693-
if(concurrent_index)
694+
if (concurrent_index)
694695
appendStringInfo(&str, "%s CONCURRENTLY index_%u ON %s USING %s (%s)%s",
695696
stmt.create, index, stmt.table, stmt.type, stmt.columns, stmt.options);
696697
else

regress/expected/tablespace.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ INSERT INTO testts1 (data) values ('b');
1919
INSERT INTO testts1 (data) values ('c');
2020
-- check the indexes definitions
2121
SELECT regexp_replace(
22-
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL),
22+
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL, false),
2323
'_[0-9]+', '_OID', 'g')
2424
FROM pg_index i join pg_class c ON c.oid = indexrelid
2525
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
@@ -31,7 +31,7 @@ WHERE indrelid = 'testts1'::regclass ORDER BY relname;
3131
(3 rows)
3232

3333
SELECT regexp_replace(
34-
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo'),
34+
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo', false),
3535
'_[0-9]+', '_OID', 'g')
3636
FROM pg_index i join pg_class c ON c.oid = indexrelid
3737
WHERE indrelid = 'testts1'::regclass ORDER BY relname;

regress/sql/tablespace.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ INSERT INTO testts1 (data) values ('c');
1818

1919
-- check the indexes definitions
2020
SELECT regexp_replace(
21-
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL),
21+
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL, false),
2222
'_[0-9]+', '_OID', 'g')
2323
FROM pg_index i join pg_class c ON c.oid = indexrelid
2424
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
2525

2626
SELECT regexp_replace(
27-
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo'),
27+
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo', false),
2828
'_[0-9]+', '_OID', 'g')
2929
FROM pg_index i join pg_class c ON c.oid = indexrelid
3030
WHERE indrelid = 'testts1'::regclass ORDER BY relname;

0 commit comments

Comments
 (0)