Because AOLserver3.0 has a broken ns_getcsv
function, I have to run a copy of 2.3.3, which has built in table browsing under /NS/Db/. There is no index browsing, but you do get system tables listed. After using Don's ls method above, I tried the following with success:
- Create a table with a unique index:
create table my_table (
user_id integer not null primary key,
email varchar(100) not null,
unique(email))
- List indexes on table of interest (my_table):
select * from pg_indexes where tablename = 'my_table'
This gave me indexes named my_table_pkey
and
my_table_email_key
.
- Insert some data.
- Alter table:
alter table my_table add domain varchar(100) not null
- Insert some domain data:
update my_table set domain = 'mydomain.com'
- Drop unique index on email:
drop index my_table_email_key
- Create new unique index:
create unique index my_table_email_domain_key on my_table(email,domain)