Search Postgresql Archives

Converting non-null unique idx to pkey

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

 



I'm preparing a fairly large 7.4.6 DB for trigger-based 
replication.  I'm looking for ways to minimize my impact on the 
existing schema & data and uptime.  This replication solution 
requires every table to have a primary key.  Rather than adding 
a new key column and index for the pkey, it's appealing to just 
to reuse existing unique indices on non-null columns.  Are there 
are any known or obvious gotchas associated with transforming a 
unique index on a non null column into a primary key via this 
sql?

update pg_index 
set indisprimary = 't' 
where indexrelid = <my non-null unique index oid>

TIA.
Ed

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[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