Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8CD2C632CDB for ; Thu, 8 Jul 2010 12:42:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 03582-04 for ; Thu, 8 Jul 2010 15:42:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id A8769632351 for ; Thu, 8 Jul 2010 12:42:35 -0300 (ADT) Received: by wyf23 with SMTP id 23so663997wyf.19 for ; Thu, 08 Jul 2010 08:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=+xPgSsxKUerc9KrCo7HfDKCNZGf60ME9ROKLsUiuZwg=; b=cblo6rrXl3tjudPBnGOeNC9vl0MggEmXuBELxgr9gFkzjF3GYQ2SiqcyphZeIbj/Hp NaZT/H2tAF3nnH65ZnA0FXzcFlsnnf3iEEO3rh4MpS6gYiC6wrdDAINZllPd2CDiYpcc 61r6BvVMj1cpxDxWUFD6570eSeseNe2zT6OpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=W43m0+z7QlQsComUes2GspbMZcHF+fKitA/Irbjp88V+3CqNia5K0tOTndwYTzl1OI 8qsq7ycPc69DZWeaBS3rR8YxtPXOYY1RHw7CTv2YYHeoU9D5kpQoeBQyelQ2wC9zooOZ SO/IcgrnHKUFCe0xFVPSAfsNNDrPMBVjWo/O8= Received: by 10.216.68.20 with SMTP id k20mr2788772wed.29.1278603745281; Thu, 08 Jul 2010 08:42:25 -0700 (PDT) Received: from marco-dalibo.localnet (gev44-1-78-228-108-65.fbx.proxad.net [78.228.108.65]) by mx.google.com with ESMTPS id m40sm1238713wej.16.2010.07.08.08.42.23 (version=SSLv3 cipher=RC4-MD5); Thu, 08 Jul 2010 08:42:24 -0700 (PDT) From: Marc Cousin To: Tom Lane Subject: Re: =?iso-8859-6?q?CREATE=A0OPERATOR_and?= precedence Date: Thu, 8 Jul 2010 17:42:22 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34-ARCH; KDE/4.4.5; x86_64; ; ) Cc: pgsql-docs@postgresql.org References: <201007081628.30860.cousinmarc@gmail.com> <24641.1278599501@sss.pgh.pa.us> In-Reply-To: <24641.1278599501@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Message-Id: <201007081742.22830.cousinmarc@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201007/68 X-Sequence-Number: 5724 The Thursday 08 July 2010 16:31:41, Tom Lane wrote : > Marc Cousin writes: > > I just got caught by a precedence problem with CREATE OPERATOR. > >=20 > > 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. >=20 > 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 >=20 > http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html#SQL-PRE= CE > DENCE >=20 > regards, tom lane Yes, that's what I found out, afterwards. =46rom a technical point of view, I obviously totally agree, operators have= no=20 control over precedence, but I was only reporting this because I thought th= at=20 it might be helpful to put something like a pointer to this table in the=20 CREATE OPERATOR doc. =46rom the user's point of view, even if precedence is hard-wired in the pa= rser,=20 a note about it could help here, if only as a reminder. The first thing I=20 thought when facing the problem was : "how do I specify the precedence ?". = I=20 found out I couldn't, but a pointer or a note would have been even easier.