FAQ
Hi all,

I've got a column in one of my tables that references another column in
another table
i.e. barcode REFERENCES product(barcode)

Is there a way to drop this referential integrity for a while and then
reinstate it?



--
Rob

He who dies with the most toys ...

... still dies

Search Discussions

  • Joshua b. Jore at Apr 15, 2002 at 12:56 pm
    Temporarily disable the triggers on that table and then re-enable them
    afterwards. The trick is to set pg_class.reltriggers = 0 to disable and
    then restore it to the correct number of triggers afterward. Play with
    pg_restore or search the recent (last month) archives for more on this.
    If you give pg_restore enough information it will disable triggers oduring
    the load. You'd want to read that for an example of the correct SQL. Also,
    I posted last month two functions to disable/enable all non-system
    triggers in on swell foop. Look in the archives for that.

    Joshua b. Jore
    http://www.greentechnologist.org
    On Mon, 15 Apr 2002, Rob wrote:

    Hi all,

    I've got a column in one of my tables that references another column in
    another table
    i.e. barcode REFERENCES product(barcode)

    Is there a way to drop this referential integrity for a while and then
    reinstate it?



    --
    Rob

    He who dies with the most toys ...

    ... still dies


    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedApr 15, '02 at 8:01a
activeApr 15, '02 at 12:56p
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Joshua b. Jore: 1 post Rob: 1 post

People

Translate

site design / logo © 2022 Grokbase