Altering multiple column types
От | Bharanee Rathna |
---|---|
Тема | Altering multiple column types |
Дата | |
Msg-id | CAOX4-H5ZDSdt8nUPWRmWfkR479kFR2_vAqETn4bkpcNnGa+VtQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Altering multiple column types
Re: Altering multiple column types |
Список | pgsql-general |
Hi,
I'm encountering an issue altering multiple column types in a single ALTER TABLE
psql (12beta2, server 11.4)
Type "help" for help.
test=# create table users(id serial primary key, name varchar(255), age int, email varchar(255));
CREATE TABLE
test=# create index users_name_idx on users(name);
CREATE INDEX
test=# create index users_email_idx on users(email);
CREATE INDEX
test=# alter table users alter column name type text, alter column email type text;
psql: ERROR: relation "users_name_idx" already exists
test=# alter table users alter column name type text;
ALTER TABLE
test=# alter table users alter column email type text;
ALTER TABLE
Is there a limitation I'm missing in the docs ?
https://www.postgresql.org/docs/11/sql-altertable.html
Thanks
В списке pgsql-general по дате отправления: