Thread: type cast

type cast

From
Imre Horvath
Date:
Hi!

I don't know if it's the right place or the psycopg2 list:

I've got a plpython function, with a character varying param.
I can call it from sql.
But when i try to call it with psycopg2.callproc('testfunc', ['test']),
i've got the error:
function testfunc(unknown) does not exist
HINT:  No function matches the given name and argument types. You might
need to add explicit type casts.

Thanks in advance:
Imre Horvath



Re: type cast

From
Peter Eisentraut
Date:
On tis, 2010-08-10 at 18:38 +0200, Imre Horvath wrote:
> Hi!
> 
> I don't know if it's the right place or the psycopg2 list:
> 
> I've got a plpython function, with a character varying param.
> I can call it from sql.
> But when i try to call it with psycopg2.callproc('testfunc', ['test']),
> i've got the error:
> function testfunc(unknown) does not exist
> HINT:  No function matches the given name and argument types. You might
> need to add explicit type casts.

psycopg list.  But you should add version information about psycopg and
PostgreSQL.



Re: type cast

From
Tom Lane
Date:
Imre Horvath <blemidon@gmail.com> writes:
> I've got a plpython function, with a character varying param.
> I can call it from sql.
> But when i try to call it with psycopg2.callproc('testfunc', ['test']),
> i've got the error:
> function testfunc(unknown) does not exist
> HINT:  No function matches the given name and argument types. You might
> need to add explicit type casts.

That doesn't sound like a type cast issue.  I'd bet you connected to the
wrong database from your python app, or are using a different
search_path setting, or something along that line.
        regards, tom lane