pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedplpython docs should say 'plpy.Error' instead of ERROR
2+ messages / 2 participants
[nested] [flat]
* plpython docs should say 'plpy.Error' instead of ERROR
@ 2010-11-09 10:21 Marti Raudsepp <marti@juffo.org>
0 siblings, 1 reply; 2+ messages in thread
From: Marti Raudsepp @ 2010-11-09 10:21 UTC (permalink / raw)
To: 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
Attachments:
0001-docs-plpython-has-plpy.Error-instead-of-plpy.ERROR.patch (text/x-patch, 1.1K) download
From b058cb36433aabc34325ce7eb8f5fb67aa2441cb Mon Sep 17 00:00:00 2001
From: Marti Raudsepp <marti@juffo.org>
Date: Tue, 9 Nov 2010 12:15:39 +0200
Subject: [PATCH] docs: plpython has plpy.Error instead of plpy.ERROR
---
doc/src/sgml/plpython.sgml | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml
index 6eb884e..9fc8808 100644
--- a/doc/src/sgml/plpython.sgml
+++ b/doc/src/sgml/plpython.sgml
@@ -954,8 +954,8 @@ $$ LANGUAGE plpythonu;
<function>plpy.fatal</function> actually raise a Python exception
which, if uncaught, propagates out to the calling query, causing
the current transaction or subtransaction to be aborted.
- <literal>raise plpy.ERROR(<replaceable>msg</>)</literal> and
- <literal>raise plpy.FATAL(<replaceable>msg</>)</literal> are
+ <literal>raise plpy.Error(<replaceable>msg</>)</literal> and
+ <literal>raise plpy.Fatal(<replaceable>msg</>)</literal> are
equivalent to calling
<function>plpy.error</function> and
<function>plpy.fatal</function>, respectively.
--
1.7.3.2
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: plpython docs should say 'plpy.Error' instead of ERROR
@ 2010-11-09 14:34 Alvaro Herrera <alvherre@commandprompt.com>
parent: Marti Raudsepp <marti@juffo.org>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2010-11-09 14:34 UTC (permalink / raw)
To: Marti Raudsepp <marti@juffo.org>; +Cc: pgsql-docs
Excerpts from Marti Raudsepp's message of mar nov 09 07:21:54 -0300 2010:
> 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.
Thanks, pushed to 9.0 and HEAD.
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2010-11-09 14:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 10:21 plpython docs should say 'plpy.Error' instead of ERROR Marti Raudsepp <marti@juffo.org>
2010-11-09 14:34 ` Alvaro Herrera <alvherre@commandprompt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox