Re: [GENERAL] Make "(composite).function_name" syntax work without search_path changes?

2017-10-30 Thread Tom Lane
"David G. Johnston" writes: > The system knows that the datatype being inspected is "altschema.alttype" - > would it be reasonable for the system to check for a function named "label" > in the same schema as the target type, "altschema", with the target > argument type

[GENERAL] Make "(composite).function_name" syntax work without search_path changes?

2017-10-30 Thread David G. Johnston
CREATE SCHEMA altschema; CREATE TYPE altschema.alttype AS ( altid text, altlabel text ); CREATE FUNCTION altschema.label(item altschema.alttype) RETURNS text LANGUAGE sql AS $$ SELECT (item).altlabel; $$; WITH vals (v) AS ( SELECT ('1', 'One')::altschema.alttype ) SELECT (v).label FROM vals; --