Re: Problem with function, type cast?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problem with function, type cast?
Date: 2008-05-16 07:19:02
Message-ID: 20080516071902.GB25119@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

am Thu, dem 15.05.2008, um 16:47:33 +0200 mailte A B folgendes:
> I have written this little silly function
>
> CREATE OR REPLACE FUNCTION recordMail(customerId_ integer, message_
> VARCHAR(240)) RETURNS void AS $$
> BEGIN
> INSERT INTO MailRecord (custid,message) VALUES (customerId_, message_);
> END;
> $$ LANGUAGE plpgsql;
>
> And it is created, and then I do:
>
> select recordMail(10,'asd');
>
> and I get
>
>
> ERROR: function recordmail(integer, "unknown") does not exist
> LINE 1: select recordMail(10,'asd');

Sorry, but i can't reproduce this error:

test=# create table mailrecord (custid int, message text);
CREATE TABLE
test=*# CREATE OR REPLACE FUNCTION recordMail(customerId_ integer, message_
test(# VARCHAR(240)) RETURNS void AS $$
test$# BEGIN
test$# INSERT INTO MailRecord (custid,message) VALUES (customerId_, message_);
test$# END;
test$# $$ LANGUAGE plpgsql;
CREATE FUNCTION
test=*# select recordMail(10,'asd');
recordmail
------------

(1 row)

test=*#

Which version do you have? I have 8.1.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Leo 2008-05-16 19:17:49 Need values for encoding table
Previous Message A B 2008-05-16 05:36:43 Re: type cast of function arguments