Search Postgresql Archives

Altering multiple column types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux