Re: Where is the char and varchar length in pg_catalog for function input variables - Mailing list pgsql-general

From Tom Lane
Subject Re: Where is the char and varchar length in pg_catalog for function input variables
Date
Msg-id 19559.1346861104@sss.pgh.pa.us
Whole thread Raw
In response to Where is the char and varchar length in pg_catalog for function input variables  (jam3 <jamorton3@gmail.com>)
List pgsql-general
jam3 <jamorton3@gmail.com> writes:
> I have searched and searched and just cannot find the maximum lengths for
> input variables in a function

> CREATE FUNCTION test(input1 char(5), input2 varchar(50))
> RETURNS void AS
> $$RAISE NOTICE('%,%'), $1, $2;$$
> LANGUAGE plpgsql;

> Where do I find the 5 and the 50 it has to be somewhere

No, it doesn't have to be, and it isn't.  As far as PG is concerned,
the inputs to this function are just of type "char" and "varchar".
You're allowed to write extra decoration but it's ignored.

            regards, tom lane


pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: "Too far out of the mainstream"
Next
From: Pavan Deolasee
Date:
Subject: Re: Where is the char and varchar length in pg_catalog for function input variables