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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: jam3 <jamorton3(at)gmail(dot)com>, 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:33:14
Message-ID: CAFj8pRCBHFYUZrNM-MWVZiohoOY5N2srx1Do=udmJT8v=Xo9iA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2012/9/5 Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>:
>
>
> On Wed, Sep 5, 2012 at 9:10 PM, jam3 <jamorton3(at)gmail(dot)com> wrote:
>>
>> I have searched and searched and just cannot find the maximum lengths for
>> input variables in a function
>>
>> i.e.
>>
>> 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 I have searched
>> through
>> pg_proc
>> pg_type
>> pg_attribute (whose attlen only relates to tables)
>> pg_type
>>
>> and all possible manner of joining these tables.
>>
>
> Hmm. I only looked at the code and hence don't have a definite answer. But
> it seems that information is not stored anywhere. That might explain why the
> function you mentioned accepts parameters with any character length.
>

yes, this information is just ignored - functions drops typmods

Regards

Pavel

> Thanks,
> Pavan
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aleksey Tsalolikhin 2012-09-05 16:36:58 Re: postgres process got stuck in "notify interrupt waiting" status
Previous Message jam3 2012-09-05 16:25:56 Re: Where is the char and varchar length in pg_catalog for function input variables