Re: Operators and schemas - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Operators and schemas
Date
Msg-id Pine.LNX.4.30.0204151550440.834-100000@peter.localdomain
Whole thread Raw
In response to Operators and schemas  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Operators and schemas  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> After some fooling around with gram.y, I have come to the conclusion
> that there's just no way to use a schema-qualified name for an operator
> in an expression.  I was hoping we might be able to write something like
>     operand1 schema.+ operand2
> but I can't find any way to make this work without tons of shift/reduce
> conflicts.  One counterexample suggesting it can't be done is that
>     foo.*
> might be either a reference to all the columns of foo, or a qualified
> operator name.

What about foo."*"?

> We can still put operators into namespaces and allow qualified names in
> CREATE/DROP OPERATOR.  However, lookup of operators in expressions would
> have to be completely dependent on the search path.  That's not real
> cool; among other things, pg_dump couldn't guarantee that dumped
> expressions would be interpreted the same way when reloaded.

We could make some sort of escape syntax, like
   op1 myschema.operator(+) op2

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inefficient handling of LO-restore + Patch
Next
From: "Rod Taylor"
Date:
Subject: Re: Operators and schemas