Re: Check column result size in functions

2023-12-12 Thread David G. Johnston
On Tue, Dec 12, 2023 at 3:13 PM Marcos Pegoraro wrote: > My functions should return varchar(5) or should return an exception, but > sometimes they return CHARACTER VARYING. Why ? > > thanks for any explanation > The observed behavior is documented.

Check column result size in functions

2023-12-12 Thread Marcos Pegoraro
My functions should return varchar(5) or should return an exception, but sometimes they return CHARACTER VARYING. Why ? create or replace function f_sql() returns varchar(5) language sql as $$select '0123456789'$$; --works, but shouldn't select * from f_sql(); create domain T5 as varchar(5);