Re: Quoting oddities when defining operators in postgres 8.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marc(at)bloodnok(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Quoting oddities when defining operators in postgres 8.3
Date: 2009-11-07 01:14:35
Message-ID: 11970.1257556475@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marc Munro <marc(at)bloodnok(dot)com> writes:
> It seems that the operator name in the create operator clause cannot be
> quoted, but in the commutator, or negator clauses, if schema-qualified,
> the operator must be quoted. If not schema-qualified it seems there is
> no need for quoting.

The correct way to write a schema-qualified operator name is
OPERATOR(foo.<)
You can get away without the OPERATOR() decoration immediately after
CREATE OPERATOR, since it's known that an operator name must appear
there, but within the definition-item list the parser is stickier
about this. It's more or less an implementation artifact that
foo."<" works at all, because that's not an operator name, it's
a regular identifier.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-07 01:17:57 Re: plperl and inline functions -- first draft
Previous Message Tom Lane 2009-11-07 00:57:42 Re: Specific names for plpgsql variable-resolution control options?