Constants in the foreighn key constraints

From: aleksey ksenzov <alekseyksenzov(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Constants in the foreighn key constraints
Date: 2019-11-22 14:32:28
Message-ID: CAB5pSh6Hdw6A6hLAQ+d--6vPzxOs6=Ad4kk5DBei91iirZLNPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi team.
Latest time we faced several issues which wouldn't arise provided we have
possibility to use constants in foreign key constraints.
brief example where it would be helpful:

table_a
( id uuid,
parent_id uuid,
is_deleted boolean
)
having possibility of FK (parent_id, false) to (id, is_deleted)
would disallow setting parent record deleted flag to true if they have
children, or insert record with is_deleted = true parent.

Regards,
Aliaksei.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-11-22 14:56:04 Re: Remote Connection Help
Previous Message Guillaume Lelarge 2019-11-22 14:10:42 Re: A question about user atributes