Thread: [pgAdmin4][Patch]: RM_ 2620 - Getting error "Violates checkconstraint" while creating pgAgent job

Hi

It gives error because database value is passed in query generated when jobstep > kind == 'batch'.
the database value must be ‘’, if jobstep > kind == 'batch' as per check constraint:

"pga_jobstep_check1" CHECK (jstdbname <> ''::name AND jstkind = 's'::bpchar OR jstdbname = ''::name AND (jstkind = 'b'::bpchar OR jstconnstr <> ''
::text))

Please find attached patch and review.

Thanks,
Surinder

Attachment
Hi Surinder 

As per discussion, this should be fixed at server side instead of client(js) side. I have fixed and committed the code. 

On Wed, Aug 2, 2017 at 6:07 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:

Hi

It gives error because database value is passed in query generated when jobstep > kind == 'batch'.
the database value must be ‘’, if jobstep > kind == 'batch' as per check constraint:

"pga_jobstep_check1" CHECK (jstdbname <> ''::name AND jstkind = 's'::bpchar OR jstdbname = ''::name AND (jstkind = 'b'::bpchar OR jstconnstr <> ''
::text))

Please find attached patch and review.

Thanks,
Surinder




--
Akshay Joshi
Principal Software Engineer 


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246