Fixed index definition tokenization
In the previous commit skip_const was going ahead the space thus removing the starting quote. Also fixed (and tested) trailing part after the tablespace name, e.g. the WHERE clause.
This commit is contained in:
		| @ -10,6 +10,7 @@ SELECT spcname FROM pg_tablespace WHERE spcname = 'testts'; | ||||
| -- If the query above failed you must create the 'testts' tablespace; | ||||
|  | ||||
| CREATE TABLE testts1 (id serial primary key, data text); | ||||
| CREATE INDEX testts1_partial_idx on testts1 (id) where (id > 0); | ||||
| INSERT INTO testts1 (data) values ('a'); | ||||
| INSERT INTO testts1 (data) values ('b'); | ||||
| INSERT INTO testts1 (data) values ('c'); | ||||
| @ -19,7 +20,8 @@ INSERT INTO testts1 (data) values ('c'); | ||||
|  | ||||
| SELECT relname, spcname | ||||
| FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace | ||||
| WHERE relname ~ '^testts1'; | ||||
| WHERE relname ~ '^testts1' | ||||
| ORDER BY relname; | ||||
|  | ||||
| SELECT * from testts1 order by id; | ||||
|  | ||||
| @ -28,21 +30,24 @@ SELECT * from testts1 order by id; | ||||
|  | ||||
| SELECT relname, spcname | ||||
| FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace | ||||
| WHERE relname ~ '^testts1'; | ||||
| WHERE relname ~ '^testts1' | ||||
| ORDER BY relname; | ||||
|  | ||||
| -- can move the ts back to default | ||||
| \! pg_repack --dbname=contrib_regression --no-order --table=testts1 -s pg_default | ||||
|  | ||||
| SELECT relname, spcname | ||||
| FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace | ||||
| WHERE relname ~ '^testts1'; | ||||
| WHERE relname ~ '^testts1' | ||||
| ORDER BY relname; | ||||
|  | ||||
| -- can move the table together with the indexes | ||||
| \! pg_repack --dbname=contrib_regression --no-order --table=testts1 --tablespace testts --moveidx | ||||
|  | ||||
| SELECT relname, spcname | ||||
| FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace | ||||
| WHERE relname ~ '^testts1'; | ||||
| WHERE relname ~ '^testts1' | ||||
| ORDER BY relname; | ||||
|  | ||||
| -- can't specify --moveidx without --tablespace | ||||
| \! pg_repack --dbname=contrib_regression --no-order --table=testts1 --moveidx | ||||
|  | ||||
		Reference in New Issue
	
	Block a user