diff options
| author | Tom Lane | 2009-12-23 17:41:45 +0000 |
|---|---|---|
| committer | Tom Lane | 2009-12-23 17:41:45 +0000 |
| commit | d68e08d1fea8b71057849321a17f87839a2ecbd0 (patch) | |
| tree | 616277b2c8595a6c8c6cc4e81d54837a60b9500f /src/test | |
| parent | c176e122222c63844c0a2f3f8c568c3fe6c57d15 (diff) | |
Allow the index name to be omitted in CREATE INDEX, causing the system to
choose an index name the same as it would do for an unnamed index constraint.
(My recent changes to the index naming logic have helped to ensure that this
will be a reasonable choice.) Per a suggestion from Peter.
A necessary side-effect is to promote CONCURRENTLY to type_func_name_keyword
status, ie, it can't be a table/column/index name anymore unless quoted.
This is not all bad, since we have heard more than once of people typing
CREATE INDEX CONCURRENTLY ON foo (...) and getting a normal index build of
an index named "concurrently", which was not what they wanted. Now this
syntax will result in a concurrent build of an index with system-chosen
name; which they can rename afterwards if they want something else.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/create_index.out | 5 | ||||
| -rw-r--r-- | src/test/regress/sql/create_index.sql | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out index 079a64098c..9dd54b39f0 100644 --- a/src/test/regress/expected/create_index.out +++ b/src/test/regress/expected/create_index.out @@ -689,7 +689,8 @@ DETAIL: Key (f2)=(b) is duplicated. -- test that expression indexes and partial indexes work concurrently CREATE INDEX CONCURRENTLY concur_index4 on concur_heap(f2) WHERE f1='a'; CREATE INDEX CONCURRENTLY concur_index5 on concur_heap(f2) WHERE f1='x'; -CREATE INDEX CONCURRENTLY concur_index6 on concur_heap((f2||f1)); +-- here we also check that you can default the index name +CREATE INDEX CONCURRENTLY on concur_heap((f2||f1)); -- You can't do a concurrent index build in a transaction BEGIN; CREATE INDEX CONCURRENTLY concur_index7 ON concur_heap(f1); @@ -711,10 +712,10 @@ Table "public.concur_heap" Indexes: "concur_index2" UNIQUE, btree (f1) "concur_index3" UNIQUE, btree (f2) INVALID + "concur_heap_expr_idx" btree ((f2 || f1)) "concur_index1" btree (f2, f1) "concur_index4" btree (f2) WHERE f1 = 'a'::text "concur_index5" btree (f2) WHERE f1 = 'x'::text - "concur_index6" btree ((f2 || f1)) "std_index" btree (f2) DROP TABLE concur_heap; diff --git a/src/test/regress/sql/create_index.sql b/src/test/regress/sql/create_index.sql index 9527ab7a7b..b205afa34f 100644 --- a/src/test/regress/sql/create_index.sql +++ b/src/test/regress/sql/create_index.sql @@ -300,7 +300,8 @@ CREATE UNIQUE INDEX CONCURRENTLY concur_index3 ON concur_heap(f2); -- test that expression indexes and partial indexes work concurrently CREATE INDEX CONCURRENTLY concur_index4 on concur_heap(f2) WHERE f1='a'; CREATE INDEX CONCURRENTLY concur_index5 on concur_heap(f2) WHERE f1='x'; -CREATE INDEX CONCURRENTLY concur_index6 on concur_heap((f2||f1)); +-- here we also check that you can default the index name +CREATE INDEX CONCURRENTLY on concur_heap((f2||f1)); -- You can't do a concurrent index build in a transaction BEGIN; |
