BUG #2917: spi_prepare doesn't accept typename aliases such as 'integer'

Lists: pgsql-bugs
From: "Vlad Dan Dascalescu" <ddascalescu(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2917: spi_prepare doesn't accept typename aliases such as 'integer'
Date: 2007-01-22 07:28:19
Message-ID: 200701220728.l0M7SJDt065930@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2917
Logged by: Vlad Dan Dascalescu
Email address: ddascalescu(at)gmail(dot)com
PostgreSQL version: 8.2.1
Operating system: RHEL AS 4
Description: spi_prepare doesn't accept typename aliases such as
'integer'
Details:

In a PL/Perl stored procedure,

spi_prepare('...query...', 'integer')

generates the following error when spi_prepare ends up being called:

ERROR: error from Perl function: type "integer" does not exist at line X.

Replacing 'integer' with 'INT4' solves the issue. Same for 'float4'
replacing 'real' etc.

An additional issue is that error messages are consistent with 'integer' and
'real', not with 'int4' and 'float4':

ERROR: error from Perl function: invalid input syntax for type real: "some
string here" at line X.

Hope that helps,
Vlad Dan Dascalescu