# Exception while altering table (Crate@3.2.2)

**URL:** <https://community.cratedb.com/t/exception-while-altering-table-crate-3-2-2/221>\
**Category:** CrateDB\
**Created:** [June 3, 2019, 2:54pm UTC](https://community.cratedb.com/t/exception-while-altering-table-crate-3-2-2/221 "2019-06-03T14:54:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sambhav](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/sambhav/32/293_2.png) [@sambhav](https://community.cratedb.com/u/sambhav)\
**Post date:** [June 3, 2019, 2:54pm UTC](https://community.cratedb.com/t/exception-while-altering-table-crate-3-2-2/221/1 "2019-06-03T14:54:56Z")

</div>

Suppose we have a table;

```
cr> create table documents_a (
... title text,
... body text,
... INDEX title_body_ft
... using fulltext(title, body) with (analyzer = 'english')
... );

```

**Now we need to alter and add a column in it such that it contains all the other field values**

`alter table documents_a ADD COLUMN new_column string index using fulltext("body","title","new_column") with (analyzer = 'english');`

This gives following exception :

> SQLActionException[SQLParseException: line 1:74: extraneous input ‘(’ expecting {, ‘NOT’, ‘PRIMARY KEY’, ‘INDEX’, ‘STORAGE’, ‘;’}]

**How to resolve this exception and where am I doing it wrong. Also, I want to have values of all the columns in the newly added column.**  
**Crate Version : 3.2.2**  
**JDK : 1.8**

---

<div class="post-metadata">

**Author:** ![smu](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/smu/32/60_2.png) [@smu](https://community.cratedb.com/u/smu)\
**Post date:** [June 13, 2019, 9:10am UTC](https://community.cratedb.com/t/exception-while-altering-table-crate-3-2-2/221/2 "2019-06-13T09:10:19Z")

</div>

CrateDB doesn’t support adding an index column using `ALTER TABLE` (after table creation), it must be defined on `CREATE TABLE`.  
If it is required to do it later on, a workaround could be to create a new table, copy data over via insert-from-subquery, drop the old table, rename the new one.

---

<div class="post-metadata">

**Author:** ![sambhav](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/sambhav/32/293_2.png) [@sambhav](https://community.cratedb.com/u/sambhav)\
**Post date:** [June 13, 2019, 12:21pm UTC](https://community.cratedb.com/t/exception-while-altering-table-crate-3-2-2/221/3 "2019-06-13T12:21:43Z")

</div>

Thanks for the workaround Sebastian @smu  
But what if data is \>10gb, copying it again and again, would be so time-consuming? 😨
