citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.46k stars 663 forks source link

Can not reindex with CONCURRENTLY in Azure Hyperscale(citus) #5500

Closed hailv82 closed 2 years ago

hailv82 commented 2 years ago

Hi Team, We can create index with CONCURRENTLY, but can not reindex with CONCURRENTLY in in Azure Hyperscale(citus). Please help to check.

citus=> create table backup.table1(a int, b int);
CREATE TABLE
citus=> CREATE INDEX CONCURRENTLY  index_table1 ON backup.table1(a);
CREATE INDEX
citus=> REINDEX  index  concurrently backup.index_table1;
**ERROR:  syntax error at or near "concurrently"
LINE 1: REINDEX  index  concurrently backup.index_table1;**
                        ^
citus=>

Version Postgres and Citus

citus=> select version();
                                                     version
------------------------------------------------------------------------------------------------------------------
 PostgreSQL 11.10 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, 64-bit
(1 row)
citus=> select citus_version();
                                                             citus_version
---------------------------------------------------------------------------------------------------------------------------------------
 Citus Enterprise 9.5.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, 64-bit gitref: v9.5.4
(1 row)

citus=>
onderkalaci commented 2 years ago

Hi @levanhai82, re-index concurrently is added to PG 12. See docs: https://www.postgresql.org/docs/12/sql-reindex.html

And, Citus 9.0+ supports it on distributed tables, see here.

So, you should be both PG12+ and Citus 9.5+.

I'm closing the issue, feel free to open a support ticket on Hyperscale(Citus) for upgrade