vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I need to convert an existing unique index on a very heavily inserted table into a primary key. Alter table works, but locks the table for too long. As a hack, can I just set pg_index.indisprimary = 't' and pg_constraint.contype = 'p' for the appropriate row in each? This is for 7.4.6 and 8.0beta3... TIA... Ed ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org |
| ||||
| "Ed L." <pgsql@bluepolka.net> writes: > I need to convert an existing unique index on a very heavily inserted table > into a primary key. Alter table works, but locks the table for too long. > As a hack, can I just set pg_index.indisprimary = 't' and > pg_constraint.contype = 'p' for the appropriate row in each? This is for > 7.4.6 and 8.0beta3... Don't forget to make the underlying columns notnull, too. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html |