sql - Add unique constraint to an existing PostgreSQL index -
i have index in postgresql 9.3 database:
create index index_foos_on_bar_and_baz on foos using btree (bar, baz);
(from schema migration using ruby on rails)
the index present , made things faster. i've cleaned duplicate foos, i'd make index unique:
create unique index index_foos_on_bar_and_baz on foos using btree (bar, baz);
is there way alter existing index , make unique? or easier/faster delete existing index , create new, unique one?
there no way change index unique index. can see can change index @ alter index document.
in case need drop , create new unique index.
Comments
Post a Comment