Calling function from VFP changes character field to Memo - Mailing list pgsql-general

From Frank Cazabon
Subject Calling function from VFP changes character field to Memo
Date
Msg-id fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com
Whole thread Raw
Responses Re: Calling function from VFP changes character field to Memo
Re: Calling function from VFP changes character field to Memo
List 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




pgsql-general by date:

Previous
From: "Karthik Jagadish (kjagadis)"
Date:
Subject: Index not getting cleaned even though vacuum is running
Next
From: Adrian Klaver
Date:
Subject: Re: Calling function from VFP changes character field to Memo