Greetings,
I have a problem passing AVPs to stored procedures (or in other SQL contexts) that require an integer argument. It is not a show-stopper, it just throws a warning:
0(6535) PG[get_columns]: Unhandled data type column (my_stored_proc) OID (869), defaulting to STRING
This results from something like:
avp_db_query("SELECT my_stored_proc($avp(S:my_avp))");
Now, $avp(S:my_avp) is a numerical value, so it does end up working. However, because AVPs are not natively "typed" as numerical or string values in a way that is represented at the Postgres layer of the avpops implementation, evidently, this situation arises.
Is there any way to fix this? I have tried using CAST() in the SQL statement, but that did not appear to help.
Thanks,
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : +1-678-954-0670 Direct : +1-678-954-0671
On Fri, 12 Oct 2007, Alex Balashov wrote:
Is there any way to fix this? I have tried using CAST() in the SQL statement, but that did not appear to help.
In other words, I tried:
avp_db_query("SELECT my_stored_proc(CAST('$avp(S:my_avp)' AS bigint))");
But same error results.
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : +1-678-954-0670 Direct : +1-678-954-0671
Alex Balashov wrote:
On Fri, 12 Oct 2007, Alex Balashov wrote:
Is there any way to fix this? I have tried using CAST() in the SQL statement, but that did not appear to help.
In other words, I tried:
avp_db_query("SELECT my_stored_proc(CAST('$avp(S:my_avp)' AS
bigint))");
It looks like the return type of my_stored_proc is not known by the openser postgres module. Postgres OID 869 is mapped to type 'inet', which I guess is IP address. Maybe, instead of returning 'inet', your stored procedure could return 'string'.
On the other hand, the warning you get from the postgres module is just a notification that the return value is treated as string.
/Christian
But same error results.
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : +1-678-954-0670 Direct : +1-678-954-0671
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users