Skip site navigation (1) Skip section navigation (2)

plpython docs should say 'plpy.Error' instead of ERROR

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: plpython docs should say 'plpy.Error' instead of ERROR
Date: 2010-11-09 10:21:54
Message-ID: AANLkTi=mkHMKtmzMg7OY9rC-TinYow4XAqtKT-DgX9aF@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
Currently the PL/Python documentation claims that:
"raise plpy.ERROR(msg) and raise plpy.FATAL(msg) are equivalent to
calling plpy.error and plpy.fatal, respectively"

However, the actual names are Error and Fatal, not ERROR or FATAL
(Python is case-sensitive). Patch to fix documentation attached.

postgres=# CREATE OR REPLACE FUNCTION public.foo() RETURNS void
LANGUAGE plpythonu AS 'raise plpy.ERROR("foobar happened!")';
CREATE FUNCTION
postgres=# select foo();
ERROR:  PL/Python: AttributeError: 'module' object has no attribute 'ERROR'
CONTEXT:  PL/Python function "foo"

postgres=# CREATE OR REPLACE FUNCTION public.foo() RETURNS void
LANGUAGE plpythonu AS 'raise plpy.Error("foobar happened!")';
CREATE FUNCTION
postgres=# select foo();
ERROR:  PL/Python: plpy.Error: foobar happened!
CONTEXT:  PL/Python function "foo"

Regards,
Marti

Attachment: 0001-docs-plpython-has-plpy.Error-instead-of-plpy.ERROR.patch
Description: text/x-patch (1.1 KB)

Responses

pgsql-docs by date

Next:From: Alvaro HerreraDate: 2010-11-09 14:34:15
Subject: Re: plpython docs should say 'plpy.Error' instead of ERROR
Previous:From: Thom BrownDate: 2010-11-05 22:33:17
Subject: Re: Additional index entries and table sorting

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group