Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7052051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:20:14+00:00 2026-05-28T03:20:14+00:00

I tried to change all foreign keys in PostgreSQL at once to cascade on

  • 0

I tried to change all foreign keys in PostgreSQL at once to cascade on delete:

UPDATE pg_catalog.pg_constraint
SET confupdtype='c', confdeltype='c', confmatchtype='u'
WHERE connamespace=2200;

There are no errors, and when I inspect the tables with pgadmin, it looks right, but when I try to delete a referenced table-line it comes to a constraint error. Just the SQL statement works:

ALTER TABLE tblname
  DROP CONSTRAINT IF EXISTS  fk3e2e4a8ff123848a;

ALTER TABLE tblname
  ADD CONSTRAINT fk3e2e4a8ff123848a FOREIGN KEY (field)
      REFERENCES othertable (id) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE;

Any idea why changing pg_catalog.pg_constraint is not working? even restarting the service after didn’t help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:20:15+00:00Added an answer on May 28, 2026 at 3:20 am

    Really you shouldn’t be updating pg_* tables.

    Use a command like

    ALTER TABLE YOURTABLE DISABLE TRIGGER;

    Check this link out.

    http://archives.postgresql.org/pgsql-general/2011-10/msg00802.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using aegis -change_attributes to change the brief_description of my current change set
I am using Eclipse 3.4.1 Build M20080911-1700 I have tried to change the classpath
I've tried achieving a hover/selected color change for a particular field, but I'm thinking
I tried this JavaScript but it doesn't work - here I need to change
How to change cell background image on click on cell in iphone????I have tried
Is it possible to change PowerPacks.LineShape smoothingMode? I tried to use this code(a class
Anything I have tried didn't work. Currenly I have following code to change asp.net
How do I change validates_numericality_of :test, :greater_than_or_equal_to=>0 into validate form I tried only character
I have links like these that I want to change: mypage.com?page=missions&id=5 mypage.com?page=hello I tried
I'm trying to change the default value of a foreignkey-formfield to set a Value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.