postgresqlforeign-keystable-relationships

PgSQL default action on UPDATE | DELETE of foreign keys


In PostgreSQL what is the default action over a child table referencing with foreign keys a parent table, on the UPDATE / DELETE events?

The possible ones listed are the following:

NO ACTION | RESTRICT | CASCADE | SET NULL | SET DEFAULT

I imagine it could be NO ACTION, but the official documentation does not specify it in the events paragraph of the SELECT statement specs (unfortunately, the deeplink to the paragraph is not referenceable).


Solution

  • It's right there in the description of the REFERENCES clause

    Quote from the manual

    NO ACTION

    .... This is the default action.