Smallint needs explicit cast in psql?

From: Matt Musgrove <MMusgrove(at)efji(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Cc: Judy Loomis <JLoomis(at)efji(dot)com>
Subject: Smallint needs explicit cast in psql?
Date: 2012-07-16 16:38:43
Message-ID: C0FE28B9352B6F4F8CE371643EC3B25121082449@EFJDFWMB01.EFJDFW.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Does psql require smallints to be explicitly cast as such? If so then where is this documented? If not then what am I doing wrong? :)

Given the simplest test case I could think of:

CREATE OR REPLACE FUNCTION test_issue(
parm smallint
) RETURNS VOID AS $$
BEGIN
RETURN;
END;
$$ LANGUAGE plpgsql;

nms=# \df test_issue
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+------------+------------------+---------------------+--------
public | test_issue | void | parm smallint | normal
(1 row)

nms=# select test_issue(1);
ERROR: function test_issue(integer) does not exist
LINE 1: select test_issue(1);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

Matthew Musgrove
EF Johnson Technologies, Inc.
Senior Design Engineer

O 972.819.2357
F 972.819.0639
E mmusgrove(at)efji(dot)com<mailto:mmusgrove(at)efji(dot)com>

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2012-07-16 17:03:50 Re: Smallint needs explicit cast in psql?
Previous Message Tom Burns 2012-07-16 10:30:28 Fw: Selecting Fields in Union in Subquery