Easy way to call a plpgsql function?

From: Ken Corey <ken(at)kencorey(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Easy way to call a plpgsql function?
Date: 2001-02-06 07:56:57
Message-ID: 0102060756570M.18716@kenlinux.bithub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I'm trying to call a plpgsql function:
func(varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255));

With:
GRE=# select IU_EMPLOYEE ('f','f','f','f'',f','f','f','f','f','f','f');
ERROR: Function 'iu_employee(unknown, unknown, unknown, unknown, unknown,
unknown, unknown, unknown, unknown, unknown)' does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts
GRE=#

I thought maybe overloading causes this...so I cast all the arguments as
varchars, and sure enough...

GRE=# select IU_EMPLOYEE (cast('f' as varchar),cast('f' as varchar),cast('f'
as varchar),cast('f' as varchar),cast('f' as varchar),cast('f' as
varchar),cast('f' as varchar),cast('f' as varchar),cast('f' as
varchar),cast('f' as varchar),cast('f' as varchar));
iu_employee
-------------
1
(1 row)

GRE=#

How can I tell plpgsql that an arg like 'f' means varchar (other than casting
it for every sql function call)?

--
Ken Corey, CTO Atomic Interactive, Ltd.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ken Corey 2001-02-06 08:06:41 Re: Easy way to call a plpgsql function?
Previous Message The Hermit Hacker 2001-02-05 22:57:26 Re: When replication?