Re: plperl db access documentation enhancement - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: plperl db access documentation enhancement
Date
Msg-id 201002051812.o15ICpQ20382@momjian.us
Whole thread Raw
In response to plperl db access documentation enhancement  (Alexey Klyukin <alexk@commandprompt.com>)
Responses Re: plperl db access documentation enhancement
List pgsql-hackers
Patch applied for 9.0.  We don't normally backpatch such documentation
improvements unless we receive multiple reports of confusion.

---------------------------------------------------------------------------

Alexey Klyukin wrote:
> Hello,
> 
> We were asked by Enova Financial to improve the documentation of PL/Perl database access functions.
> Alvaro and me worked on that and we produced the patch that is attached. It splits initial block of functions
> into the groups with the description directly following each of the group, corrects couple of mistakes and
> adds an example.
> 
> One of the existing mistakes was confusion in definitions of spi_exec_prepared and spi_query_prepared.
> Another one is usage of INTEGER type to return the result of spi_prepare in the example for prepared queries.
> When trying to execute that function I've got the following error:
> 
> postgres=# CREATE OR REPLACE FUNCTION init() RETURNS INTEGER AS $#
>     $_SHARED{my_plan} = spi_prepare( 'SELECT (now() + $1)::date AS now', 'INTERVAL');
> $$ LANGUAGE plperl;
> 
> CREATE FUNCTION
> 
> postgres=# select init();
> ERROR:  invalid input syntax for integer: "0x1007d6f40"
> CONTEXT:  PL/Perl function "init"
> 
> Since the return value is not used anyway, I've changed the return type of the function declaration in the example to
VOID.
> 
> I think this is a good reason to suggest backpatching these changes  down to 8.2. 
> 
> 

[ Attachment, skipping... ]

> 
> 
> --
> Alexey Klyukin                    http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc
> 
> 
> -- 
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Confusion over Python drivers
Next
From: Alvaro Herrera
Date:
Subject: Re: plperl db access documentation enhancement