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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Make "(composite).function_name" syntax work without search_path changes?
Date: 2017-10-30 23:21:51
Message-ID: 13482.1509405711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> 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 and invoke it if present?

The rule is that (v).label is equivalent to label(v), therefore it will
only find function "label" if that's in your search path. I am very
much not excited about randomly enlarging the search path depending on
syntax --- quite aside from the difficulty of documenting it clearly,
that seems like a great recipe for security hazards.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-10-30 23:56:50 From the "SQL is verbose" department, WINDOW RANGE specifications
Previous Message Laurenz Albe 2017-10-30 22:57:34 Re: query not scaling