Обсуждение: BUG #9148: generate invalid index (create index CONCURRENTLY ... )

Поиск
Список
Период
Сортировка

BUG #9148: generate invalid index (create index CONCURRENTLY ... )

От
tiyukeji@126.com
Дата:
The following bug has been logged on the website:

Bug reference:      9148
Logged by:          tanhongwei(谭洪伟)
Email address:      tiyukeji@126.com
PostgreSQL version: 9.1.9
Operating system:   Debian GNU/Linux 6.0
Description:

eg :

canceling  sql :
 CREATE INDEX  CONCURRENTLY   t_1_index
  ON t_1  USING btree
  (name);

result:
   index t_1_index exist, but size 0

note:
    select * from pg_index
    where indisvalid  <> true
result :
   have record.

Re: BUG #9148: generate invalid index (create index CONCURRENTLY ... )

От
Tom Lane
Дата:
tiyukeji@126.com writes:
> canceling  sql :
>  CREATE INDEX  CONCURRENTLY   t_1_index
>   ON t_1  USING btree
>   (name);

> result:
>    index t_1_index exist, but size 0

This is expected when using CREATE INDEX CONCURRENTLY.  See the
notes at
http://www.postgresql.org/docs/9.3/static/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY
which say
"If a problem arises while scanning the table ... the CREATE INDEX command
will fail but leave behind an "invalid" index."

            regards, tom lane