Use UNKNOWN with PL/Perl spi_prepare()?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Subject: Use UNKNOWN with PL/Perl spi_prepare()?
Date: 2010-04-06 23:17:50
Message-ID: 30D6137D-B0A4-4769-9EFB-FFE4B9BFB06F@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

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.

I could figure out no way to specify an that a data type is unknown (as opposed to known to be "unknown"). Specifying 0 doesn't work, either:

try=# create or replace function try() returns void language plperl as $$
spi_prepare('select length($1)', 0);
$$;
CREATE FUNCTION
try=# select try();
ERROR: error from Perl function "try": syntax error at or near "0" at line 2.

Is there a way to do this? If not, should there be?

Thanks,

David

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-04-06 23:40:39 Re: Use UNKNOWN with PL/Perl spi_prepare()?
Previous Message Tom Lane 2010-04-06 22:48:52 Re: Win32 timezone matching