Fix existing 'tablespace' regression test so it passes again.
Changes to repack_indexdef() had broken this test.
This commit is contained in:
parent
f3fa2fa563
commit
b804c150ac
@ -666,6 +666,7 @@ repack_get_order_by(PG_FUNCTION_ARGS)
|
|||||||
* @param index Oid of target index.
|
* @param index Oid of target index.
|
||||||
* @param table Oid of table of the index.
|
* @param table Oid of table of the index.
|
||||||
* @param tablespace Namespace for the index. If NULL keep the original.
|
* @param tablespace Namespace for the index. If NULL keep the original.
|
||||||
|
* @param boolean Whether to use CONCURRENTLY when creating the index.
|
||||||
* @retval Create index DDL for temp table.
|
* @retval Create index DDL for temp table.
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
@ -690,7 +691,7 @@ repack_indexdef(PG_FUNCTION_ARGS)
|
|||||||
parse_indexdef(&stmt, index, table);
|
parse_indexdef(&stmt, index, table);
|
||||||
|
|
||||||
initStringInfo(&str);
|
initStringInfo(&str);
|
||||||
if(concurrent_index)
|
if (concurrent_index)
|
||||||
appendStringInfo(&str, "%s CONCURRENTLY index_%u ON %s USING %s (%s)%s",
|
appendStringInfo(&str, "%s CONCURRENTLY index_%u ON %s USING %s (%s)%s",
|
||||||
stmt.create, index, stmt.table, stmt.type, stmt.columns, stmt.options);
|
stmt.create, index, stmt.table, stmt.type, stmt.columns, stmt.options);
|
||||||
else
|
else
|
||||||
|
@ -19,7 +19,7 @@ INSERT INTO testts1 (data) values ('b');
|
|||||||
INSERT INTO testts1 (data) values ('c');
|
INSERT INTO testts1 (data) values ('c');
|
||||||
-- check the indexes definitions
|
-- check the indexes definitions
|
||||||
SELECT regexp_replace(
|
SELECT regexp_replace(
|
||||||
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL),
|
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL, false),
|
||||||
'_[0-9]+', '_OID', 'g')
|
'_[0-9]+', '_OID', 'g')
|
||||||
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
||||||
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
||||||
@ -31,7 +31,7 @@ WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
|||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
SELECT regexp_replace(
|
SELECT regexp_replace(
|
||||||
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo'),
|
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo', false),
|
||||||
'_[0-9]+', '_OID', 'g')
|
'_[0-9]+', '_OID', 'g')
|
||||||
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
||||||
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
||||||
|
@ -18,13 +18,13 @@ INSERT INTO testts1 (data) values ('c');
|
|||||||
|
|
||||||
-- check the indexes definitions
|
-- check the indexes definitions
|
||||||
SELECT regexp_replace(
|
SELECT regexp_replace(
|
||||||
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL),
|
repack.repack_indexdef(indexrelid, 'testts1'::regclass, NULL, false),
|
||||||
'_[0-9]+', '_OID', 'g')
|
'_[0-9]+', '_OID', 'g')
|
||||||
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
||||||
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
||||||
|
|
||||||
SELECT regexp_replace(
|
SELECT regexp_replace(
|
||||||
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo'),
|
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo', false),
|
||||||
'_[0-9]+', '_OID', 'g')
|
'_[0-9]+', '_OID', 'g')
|
||||||
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
FROM pg_index i join pg_class c ON c.oid = indexrelid
|
||||||
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user