Re: Calling function from VFP changes character field to Memo

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Frank Cazabon <frank(dot)cazabon(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Calling function from VFP changes character field to Memo
Date: 2022-11-15 18:52:49
Message-ID: a94158a9-ff24-9a15-51f7-af265d052f90@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/15/22 10:44 AM, Tom Lane wrote:
> Frank Cazabon <frank(dot)cazabon(at)gmail(dot)com> writes:

>
>> Any idea what I need to do to get it to return the character(30) type?
>
> There's no chance of getting back the "30" part with this structure,
> because function signatures do not carry length restrictions.
> What I expect is happening is that you get firstname as an
> unspecified-length "character" type, and something on the client
> side is deciding to cope with that by calling it "Memo" instead.

My experience is that frameworks 'see' ::text as Memo/Textarea and
::char/varchar as Input.

>
> You could perhaps work around that by defining a named composite
> type:
>
> create type testfunction_result as (firstname character(30), ...);
>
> create function testfunction() returns setof testfunction_result as ...
>
> regards, tom lane
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Cazabon 2022-11-15 18:53:03 Re: Calling function from VFP changes character field to Memo
Previous Message Adrian Klaver 2022-11-15 18:48:32 Re: Calling function from VFP changes character field to Memo