Re: Where is the char and varchar length in pg_catalog for function input variables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jam3 <jamorton3(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Where is the char and varchar length in pg_catalog for function input variables
Date: 2012-09-05 16:05:04
Message-ID: 19559.1346861104@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

jam3 <jamorton3(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavan Deolasee 2012-09-05 16:19:48 Re: Where is the char and varchar length in pg_catalog for function input variables
Previous Message jam3 2012-09-05 15:40:41 Where is the char and varchar length in pg_catalog for function input variables