Re: Getting "ERROR: upper bound of FOR loop cannot be null" when trying to use a stored proc in a check constraint def. - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Getting "ERROR: upper bound of FOR loop cannot be null" when trying to use a stored proc in a check constraint def.
Date
Msg-id ec8bce06-c6e5-53ff-8204-d0b014b12581@aklaver.com
Whole thread Raw
In response to Getting "ERROR: upper bound of FOR loop cannot be null" when trying to use a stored proc in a check constraint def.  (David Gauthier <davegauthierpg@gmail.com>)
List pgsql-general
On 7/16/21 3:26 PM, David Gauthier wrote:
> This stored procedure ...

> dvdb=# alter table projects add constraint validate_sibling_project_csv 
> check (validate_proj_csv(sibling_project_csv) = 0);
> ERROR:  upper bound of FOR loop cannot be null
> CONTEXT:  PL/pgSQL function validate_proj_csv(character varying) line 14 
> at FOR with integer loop variable
> 
> What's going on ?

I'm going to say you have a NULL value in sibling_project_csv in the table.

> How to get this to work ?
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: David Gauthier
Date:
Subject: Getting "ERROR: upper bound of FOR loop cannot be null" when trying to use a stored proc in a check constraint def.
Next
From: Peter Geoghegan
Date:
Subject: Re: Frequetly updated partial index leads to bloat on index for Postresql 11