Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 58CD51337BDD for ; Thu, 3 Mar 2011 12:48:21 -0400 (AST) 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 14379-08 for ; Thu, 3 Mar 2011 16:48:13 +0000 (UTC) X-Greylist: delayed 00:06:40.359019 by SQLgrey-1.7.6 Received: from saucetel.com (saucetel.com [204.16.202.178]) by mail.postgresql.org (Postfix) with ESMTP id 7829E1337BC9 for ; Thu, 3 Mar 2011 12:48:13 -0400 (AST) Received: (qmail 15274 invoked by uid 1345); 3 Mar 2011 11:41:27 -0500 Received: from trimarket.initechcomputers.com (HELO ?204.16.202.180?) (abstract@saucetel.com@204.16.202.180) by saucetel.com with SMTP; 3 Mar 2011 11:41:27 -0500 Message-ID: <4D6FC4B2.2090109@schemaverse.com> Date: Thu, 03 Mar 2011 11:41:22 -0500 From: Josh User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tom Lane , mmoncure@gmail.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #5911: pg_notify() function only works when channel name is lower case References: <201103031520.p23FKxFJ049037@wwwmaster.postgresql.org> <9171.1299169493@sss.pgh.pa.us> In-Reply-To: <9171.1299169493@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 X-Spam-Level: X-Archive-Number: 201103/55 X-Sequence-Number: 29565 Thank you both for clearing that up (and doing so quite quickly!). The behavior makes complete sense now that I understand what is happening here behind the scenes. Regards, Josh On 3/3/2011 11:24 AM, Tom Lane wrote: > "Joshua McDougall" writes: >> When using the pg_notify(text,text) function, the channel name MUST be lower >> case otherwise the message does not go through. > It's not clear to me that this is a bug. The argument of NOTIFY is a > SQL identifier, which is folded to lower case by the lexer if not > double-quoted, but the argument of pg_notify is a string constant which > is a different matter altogether. > > We could have pg_notify lowercase its argument at runtime, but then > we'd have to introduce quoting rules, so that you could do > > select pg_notify('"IntentionallyMixedCase"', '...'); > > This isn't a lot clearer than the current behavior, and it definitely > wouldn't be backwards compatible. So I'm inclined to leave it alone. > > regards, tom lane