Skip to content

Commit

Permalink
The execution of regression tests is simplified
Browse files Browse the repository at this point in the history
* `allow_in_place_tablespaces` is used to
fix running regression tests locally

Signed-off-by: Daymel Bonne Solís <7658145+dbonne@users.noreply.github.com>
  • Loading branch information
dbonne committed Nov 24, 2023
1 parent b5c0d95 commit fa132db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 17 additions & 15 deletions regress/expected/tablespace.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ SET client_min_messages = warning;
--
-- Note: in order to pass this test you must create a tablespace called 'testts'
--
SET allow_in_place_tablespaces = true;
CREATE TABLESPACE testts LOCATION '';
SELECT spcname FROM pg_tablespace WHERE spcname = 'testts';
spcname
---------
Expand All @@ -23,11 +25,11 @@ SELECT regexp_replace(
'_[0-9]+', '_OID', 'g')
FROM pg_index i join pg_class c ON c.oid = indexrelid
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
regexp_replace
----------------------------------------------------------------------------------------------------------
CREATE INDEX index_OID ON repack.table_OID USING btree (id) TABLESPACE pg_default WHERE (id > 0)
CREATE UNIQUE INDEX index_OID ON repack.table_OID USING btree (id) TABLESPACE pg_default
CREATE INDEX index_OID ON repack.table_OID USING btree (id) WITH (fillfactor='80') TABLESPACE pg_default
regexp_replace
------------------------------------------------------------------------------------
CREATE INDEX index_OID ON repack.table_OID USING btree (id) WHERE (id > 0)
CREATE UNIQUE INDEX index_OID ON repack.table_OID USING btree (id)
CREATE INDEX index_OID ON repack.table_OID USING btree (id) WITH (fillfactor='80')
(3 rows)

SELECT regexp_replace(
Expand All @@ -47,23 +49,23 @@ SELECT regexp_replace(
'_[0-9]+', '_OID', 'g')
FROM pg_index i join pg_class c ON c.oid = indexrelid
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
regexp_replace
--------------------------------------------------------------------------------------------------------------
CREATE INDEX CONCURRENTLY index_OID ON testts1 USING btree (id) TABLESPACE pg_default WHERE (id > 0)
CREATE UNIQUE INDEX CONCURRENTLY index_OID ON testts1 USING btree (id) TABLESPACE pg_default
CREATE INDEX CONCURRENTLY index_OID ON testts1 USING btree (id) WITH (fillfactor='80') TABLESPACE pg_default
regexp_replace
-----------------------------------------------------------------------------------------------
CREATE INDEX CONCURRENTLY index_OID ON public.testts1 USING btree (id) WHERE (id > 0)
CREATE UNIQUE INDEX CONCURRENTLY index_OID ON public.testts1 USING btree (id)
CREATE INDEX CONCURRENTLY index_OID ON public.testts1 USING btree (id) WITH (fillfactor='80')
(3 rows)

SELECT regexp_replace(
repack.repack_indexdef(indexrelid, 'testts1'::regclass, 'foo', true),
'_[0-9]+', '_OID', 'g')
FROM pg_index i join pg_class c ON c.oid = indexrelid
WHERE indrelid = 'testts1'::regclass ORDER BY relname;
regexp_replace
-------------------------------------------------------------------------------------------------------
CREATE INDEX CONCURRENTLY index_OID ON testts1 USING btree (id) TABLESPACE foo WHERE (id > 0)
CREATE UNIQUE INDEX CONCURRENTLY index_OID ON testts1 USING btree (id) TABLESPACE foo
CREATE INDEX CONCURRENTLY index_OID ON testts1 USING btree (id) WITH (fillfactor='80') TABLESPACE foo
regexp_replace
--------------------------------------------------------------------------------------------------------------
CREATE INDEX CONCURRENTLY index_OID ON public.testts1 USING btree (id) TABLESPACE foo WHERE (id > 0)
CREATE UNIQUE INDEX CONCURRENTLY index_OID ON public.testts1 USING btree (id) TABLESPACE foo
CREATE INDEX CONCURRENTLY index_OID ON public.testts1 USING btree (id) WITH (fillfactor='80') TABLESPACE foo
(3 rows)

-- Test that a tablespace is quoted as an identifier
Expand Down
2 changes: 2 additions & 0 deletions regress/sql/tablespace.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ SET client_min_messages = warning;
--
-- Note: in order to pass this test you must create a tablespace called 'testts'
--
SET allow_in_place_tablespaces = true;
CREATE TABLESPACE testts LOCATION '';

SELECT spcname FROM pg_tablespace WHERE spcname = 'testts';
-- If the query above failed you must create the 'testts' tablespace;
Expand Down

0 comments on commit fa132db

Please sign in to comment.