Re: CHECK Constraint Deferrable

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Himanshu Upadhyaya <upadhyaya(dot)himanshu(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CHECK Constraint Deferrable
Date: 2023-07-07 14:04:41
Message-ID: CAKFQuwZf0We7p-7Df-Fyxrfv+cS=meF0DorEtuBWx5nhLZ+j9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, July 7, 2023, Himanshu Upadhyaya <upadhyaya(dot)himanshu(at)gmail(dot)com>
wrote:

> I can think of one scenario, as below
>
> 1) any department should have an employee
> 2)any employee should be assigned to a department
> so, the employee table has a FK to the department table, and another check
> constraint should be added to the department table to ensure there should
> be one/more employees in this department.
>
>
That isn’t a valid/allowed check constraint - it contains a prohibited
reference to another table.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2023-07-07 15:21:44 Re: Unlogged relations and WAL-logging
Previous Message Himanshu Upadhyaya 2023-07-07 14:00:10 Re: CHECK Constraint Deferrable