[GENERAL] Is it possible to define a constraint based on the values in otherrows in the current table? - Mailing list pgsql-general

From Glen Huang
Subject [GENERAL] Is it possible to define a constraint based on the values in otherrows in the current table?
Date
Msg-id DB1C8829-F6ED-4BAF-A165-9A2CA5DCF932@gmail.com
Whole thread Raw
Responses Re: [GENERAL] Is it possible to define a constraint based on thevalues in other rows in the current table?
List pgsql-general
Hi,

I'd like to enforce that in a transaction, after a couple inserts & updates, a particular column has continuous values like 1, 2, 3, and never any gaps. Is it possible to do?

I gave a concrete example here: https://stackoverflow.com/questions/45187113 didn't get any answers yet.

Am I looking at the wrong direction? Should such feature be implemented with constraints?

Thanks.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] hash join performance question
Next
From: vinny
Date:
Subject: Re: [GENERAL] Is it possible to define a constraint based on thevalues in other rows in the current table?