Re: Is it correct to raise an exception in a domain check

2025-06-10 Thread Tom Lane
Logan Grosz writes: > I have a `DOMAIN` on `JSONB`. I need to verify the shape of the JSON, so I > have a check expression written in PL/pgSQL. The docs say >> Each constraint must be an expression producing a Boolean result > Would it be correct to raise an exception to indicate a failed > chec

Re: Is it correct to raise an exception in a domain check

2025-06-10 Thread Ron Johnson
On Tue, Jun 10, 2025 at 4:53 PM Logan Grosz wrote: > Hi, > > I have a `DOMAIN` on `JSONB`. I need to verify the shape of the JSON, so I > have a check expression written in PL/pgSQL. The docs say > > > Each constraint must be an expression producing a Boolean result > > Would it be correct to rai

Is it correct to raise an exception in a domain check

2025-06-10 Thread Logan Grosz
Hi, I have a `DOMAIN` on `JSONB`. I need to verify the shape of the JSON, so I have a check expression written in PL/pgSQL. The docs say > Each constraint must be an expression producing a Boolean result Would it be correct to raise an exception to indicate a failed check? I perform type-casts (