Calling function from VFP changes character field to Memo

From: Frank Cazabon <frank(dot)cazabon(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Calling function from VFP changes character field to Memo
Date: 2022-11-15 17:44:13
Message-ID: fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a simple table Patients with one field FirstName of type
character(30).

If I

SELECT FirstName From public.patients;

I get back the expected character(30) field.

If however I have a function defined like this

CREATE OR REPLACE FUNCTION public.testfunction(
    )
    RETURNS TABLE
    (
        Firstname character(30)
    )
    LANGUAGE 'plpgsql'

AS $BODY$
BEGIN
    RETURN QUERY SELECT p.cFirstName FROM patients p;
END;
$BODY$;

And I call:

SELECT * FROM public.testFunction();

Then FirstName returns as a Memo field (similar to a Text field).

Any idea what I need to do to get it to return the character(30) type?

--

Frank.

Frank Cazabon

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-11-15 18:26:53 Re: Calling function from VFP changes character field to Memo
Previous Message Karthik Jagadish (kjagadis) 2022-11-15 15:46:06 Index not getting cleaned even though vacuum is running