create table test (a int4 not null); alter table test add unique(a); alter table test add unique(a); alter table test add primary key(a); alter table test add primary key(a); alter table test rename to test_old; create table test (a int4 not null); alter table test add unique(a); alter table test add unique(a); alter table test add primary key(a); alter table test add primary key(a); drop table test; drop table test_old; create table test (a int4 not null unique); alter table test add unique(a); alter table test rename to test_old; create table test (a int4 not null unique); alter table test add unique(a); drop table test; drop table test_old; create table test (a int4 not null primary key); alter table test add primary key(a); alter table test rename to test_old; create table test (a int4 not null primary key); drop table test; drop table test_old; create table test (a int4 not null, unique(a)); alter table test add unique(a); alter table test rename to test_old; create table test (a int4 not null, unique(a)); alter table test add unique(a); drop table test; drop table test_old; create table test (a int4 not null, primary key(a)); alter table test rename to test_old; create table test (a int4 not null, primary key(a)); drop table test; drop table test_old; create table test (a serial); alter table test rename to test_old; create table test (a serial); drop table test; drop table test_old;