Re: Error in PlPython procedure - Mailing list pgsql-general

From Erik Jones
Subject Re: Error in PlPython procedure
Date
Msg-id 80A1111F-DC5E-4CCA-BEA9-4A5032DEC43F@myemma.com
Whole thread Raw
In response to Error in PlPython procedure  (mars_osrp <mars_osrp@yahoo.com>)
List pgsql-general
On Feb 20, 2008, at 5:53 PM, mars_osrp wrote:

>
> Hi All,
>
> I am using PlPython procedure to insert data in a table:
>
> plan = plpy.execute("insert into test(id,name) values(1 , 'test_py')")
>
> I am getting error:
> ERROR:  invalid input syntax for integer: "<PLyResult object at
> 0x374a5a70>"
>
> In fact preparing a plan and passing a list of values for columns
> is also
> giving same error.
>
> What is correct valid input syntax for integer in PlPython?

Can you show us the function you're using and how you're using it?  I
don't see anything wrong with that on its own.  You're error refers
to using a PyResult object somewhere and integer is expected --
plpy.execute() returns PyResult objects -- not integers -- so that
looks good.  My guess is you're expecting to be able to use the
return value of plpy.execute() directly,  i.e I think your query is
running fine, it's how you're accessing the result that is the problem.

Erik Jones

DBA | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com




pgsql-general by date:

Previous
From: Dee
Date:
Subject: Install problem w/8.3 on windows 2000 : application failed to initialize properly (0xc0000022)
Next
From: hewei
Date:
Subject: Re: How to make update rapidly?