From: Marc Cousin <cousinmarc@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-docs@postgresql.org
Subject: Re: CREATE OPERATOR and precedence
Date: Thu, 8 Jul 2010 17:42:22 +0200
Message-ID: <201007081742.22830.cousinmarc@gmail.com> (raw)
In-Reply-To: <24641.1278599501@sss.pgh.pa.us>
References: <201007081628.30860.cousinmarc@gmail.com>
<24641.1278599501@sss.pgh.pa.us>
The Thursday 08 July 2010 16:31:41, Tom Lane wrote :
> Marc Cousin <cousinmarc@gmail.com> writes:
> > I just got caught by a precedence problem with CREATE OPERATOR.
> >
> > Obviously, it was mostly my fault (I didn't think of the precedence of my
> > operator at all), but I didn't find anything in the CREATE OPERATOR
> > documentation about it either.
>
> CREATE OPERATOR has nothing to say on the subject because operator
> precedences are hard-wired into the parser and can't be changed by
> CREATE OPERATOR. See
>
> http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html#SQL-PRECE
> DENCE
>
> regards, tom lane
Yes, that's what I found out, afterwards.
From a technical point of view, I obviously totally agree, operators have no
control over precedence, but I was only reporting this because I thought that
it might be helpful to put something like a pointer to this table in the
CREATE OPERATOR doc.
From the user's point of view, even if precedence is hard-wired in the parser,
a note about it could help here, if only as a reminder. The first thing I
thought when facing the problem was : "how do I specify the precedence ?". I
found out I couldn't, but a pointer or a note would have been even easier.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: cousinmarc@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: CREATE OPERATOR and precedence
In-Reply-To: <201007081742.22830.cousinmarc@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox