pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: CREATE OPERATOR and precedence
2+ messages / 2 participants
[nested] [flat]

* Re: CREATE OPERATOR and precedence
@ 2010-07-08 15:42  Marc Cousin <cousinmarc@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Marc Cousin @ 2010-07-08 15:42 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: CREATE OPERATOR and precedence
@ 2010-07-08 16:31  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Marc Cousin <cousinmarc@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2010-07-08 16:31 UTC (permalink / raw)
  To: Marc Cousin <cousinmarc@gmail.com>; +Cc: pgsql-docs

Marc Cousin <cousinmarc@gmail.com> writes:
> 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.

Oh, that's a reasonable idea.  Done in HEAD.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2010-07-08 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-07-08 15:42 Re: CREATE OPERATOR and precedence Marc Cousin <cousinmarc@gmail.com>
2010-07-08 16:31 ` Tom Lane <tgl@sss.pgh.pa.us>

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