Re: proposal: PL/Pythonu - function ereport - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: PL/Pythonu - function ereport
Date
Msg-id CAFj8pRCr88gLVr5yMm1XHR7ysGZfpAbhmCyv3HTP2yR0QeVVqA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: PL/Pythonu - function ereport  (Catalin Iacob <iacobcatalin@gmail.com>)
Responses Re: proposal: PL/Pythonu - function ereport
List pgsql-hackers
Hi

here is new version.

Now I use a common ancestor "plpy.BaseError" for plpy builtin classes. So plpy.SPIError isn't descendant of plpy.Error and then there are not possible incompatibility issues.

Instead modification builtin function plpy.debug, plpy.info, ... and introduction incompatibility I wrote new set of functions with keyword parameters (used mainly  for elevel < ERROR):

plpy.raise_debug, plpy.raise_info, plpy.raise_notice, plpy.raise_warning, plpy.raise_error and plpy.raise_fatal.

With this patch we can write:

plpy.raise_warning('some is wrong', hint = 'bla bla')
raise plpy.Error(some is wrong', sqlcode = 'XX543')

Regards

Pavel
Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Additional role attributes && superuser review
Next
From: Dilip Kumar
Date:
Subject: Re: Relation extension scalability