Quoting oddities when defining operators in postgres 8.3

From: Marc Munro <marc(at)bloodnok(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Quoting oddities when defining operators in postgres 8.3
Date: 2009-11-06 23:28:49
Message-ID: 1257550129.10631.116.camel@bloodnok.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is some oddness about the use of double quotes when defining
operators in postgres 8.3.

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.

This works:

create operator public.< (
leftarg = public.seg,
rightarg = public.seg,
procedure = public.seg_lt,
commutator = public.">",
negator = public.">=",
restrict = pg_catalog.scalarltsel,
join = pg_catalog.scalarltjoinsel
);

This does not:

create operator public."<" (
leftarg = public.seg,
rightarg = public.seg,
procedure = public.seg_lt,
commutator = public.">",
negator = public.">=",
restrict = pg_catalog.scalarltsel,
join = pg_catalog.scalarltjoinsel
);

Neither does this:

create operator public.< (
leftarg = public.seg,
rightarg = public.seg,
procedure = public.seg_lt,
commutator = public.>,
negator = public.>=,
restrict = pg_catalog.scalarltsel,
join = pg_catalog.scalarltjoinsel
);

But this does:

create operator public.< (
leftarg = public.seg,
rightarg = public.seg,
procedure = public.seg_lt,
commutator = >,
negator = >=,
restrict = pg_catalog.scalarltsel,
join = pg_catalog.scalarltjoinsel
);

This is no big deal and I have no need of a fix but I thought it odd
enough to be worth reporting.

__
Marc

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-11-06 23:37:38 Re: plperl and inline functions -- first draft
Previous Message Jeff Davis 2009-11-06 23:03:35 Re: operator exclusion constraints