Search Postgresql Archives

Re: FK Constraint on index not PK

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

 



Alvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx> writes:
> The problem is that the constraint was defined with a dependence on the
> second index.  I guess what you could do is drop the constraint, drop
> the second index, and then recreate the constraint.  Try it within a
> transaction block, just in case it doesn't work (but I don't see why it
> wouldn't)

That's certainly the safest way, but if this is a live production
database then the time spent holding exclusive locks while
re-establishing the FK constraint may be a problem.  If that's not
tolerable then the solution is manually mucking with the system
catalogs as I suggested in an earlier reply.

			regards, tom lane


[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