Re: Use UNKNOWN with PL/Perl spi_prepare()? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Use UNKNOWN with PL/Perl spi_prepare()?
Date
Msg-id 4590CABE-F9EA-4CA1-90AE-1B026160937B@kineticode.com
Whole thread Raw
In response to Re: Use UNKNOWN with PL/Perl spi_prepare()?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Use UNKNOWN with PL/Perl spi_prepare()?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Use UNKNOWN with PL/Perl spi_prepare()?  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Apr 6, 2010, at 4:40 PM, Tom Lane wrote:

>> I tried this:
>>    try=# create or replace function try() returns void language plperl as $$
>>        spi_prepare('select length($1)', 'unknown');
>>    $$;
>>    CREATE FUNCTION
>>    try=# select try();
>>    ERROR:  error from Perl function "try": failed to find conversion function from unknown to text at line 2.
>
> Why would you think this is useful, considering that plperl has no
> concept of SQL data types?  Everything you could pass to
> spi_exec_prepared is effectively text, no?
   try=# create or replace function try() returns void language plperl as $$       spi_prepare('select abs($1)',
'text');  $$;   CREATE FUNCTION   try=# select try();   ERROR:  error from Perl function "try": function abs(text) does
notexist at line 2. 

Best,

David

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use UNKNOWN with PL/Perl spi_prepare()?
Next
From: Tom Lane
Date:
Subject: Re: Use UNKNOWN with PL/Perl spi_prepare()?