From: | Luca Ferrari <fluca1978(at)gmail(dot)com> |
---|---|
To: | Sonam Sharma <sonams1209(at)gmail(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Index |
Date: | 2019-10-25 11:13:00 |
Message-ID: | CAKoxK+4esa5KRVV2uWVWXimGKZf3os=r7sDLnrB8WChUC=rHZw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, Oct 25, 2019 at 7:35 AM Sonam Sharma <sonams1209(at)gmail(dot)com> wrote:
>
> I have created indexes with certain set of columns. Now I want to remove one of the column and add new column. Can this done without dropping the index?
If you are going to rename the column the answer is yes.
If you are going to drop the column that would also invalidate and
drop the index.
If you are changing the data type the index should remain in place.
See <https://www.postgresql.org/docs/12/sql-altertable.html> in
particular paragraph about 'DROP COLUMN' and 'SET DATA TYPE'.
Luca
From | Date | Subject | |
---|---|---|---|
Next Message | Ravi Krishna | 2019-10-25 11:31:33 | Re: Index |
Previous Message | Luca Ferrari | 2019-10-25 11:03:57 | Re: Quere keep using temporary files |