Closed
Bug 794264
Opened 13 years ago
Closed 12 years ago
[crontabber] matviews should record result and messages from all stored proc calls
Categories
(Socorro :: Database, task)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 855423
People
(Reporter: peterbe, Assigned: peterbe)
References
Details
At the moment matviews.py run() methods just call the stored procedures.
Instead, it should listen to the output and if it's negative (e.g. FALSE) it should loudly log about it.
Currently it looks like this::
def run(self, connection):
cursor = connection.cursor()
cursor.callproc(self.get_proc_name())
connection.commit()
It needs to look something like this::
def run(self, connection):
cursor = connection.cursor()
cursor.callproc(self.get_proc_name())
result, messages = cursor.fetchone()
if result == 'false':
logging.error(bla bla bla messages)
connection.commit()
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → peterbe
Assignee | ||
Comment 1•13 years ago
|
||
In fact, log if there is *ANY* notice. (idea from Josh)
Assignee | ||
Comment 2•13 years ago
|
||
See here, http://www.postgresql.org/docs/9.1/static/plpgsql-errors-and-messages.html
about how to use "RAISE NOTICE"
Assignee | ||
Comment 3•13 years ago
|
||
Alternatively if the result is FALSE, then log louder (e.g. logging.warning instead of logging.info)
Comment 4•13 years ago
|
||
create function test_notice ()
returns boolean
language plpgsql
as $f$
BEGIN
RAISE NOTICE 'I raised a notice';
RETURN FALSE;
END;
$f$;
Assignee | ||
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•