Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aaAuz-0005bQ-Ja for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Feb 2016 23:38:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aaAuz-00024c-61 for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Feb 2016 23:38:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aaAuL-0001Nh-Fo for pgsql-bugs@postgresql.org; Sun, 28 Feb 2016 23:37:49 +0000 Received: from d.mail.sonic.net ([64.142.111.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aaAuC-0007ZL-LE for pgsql-bugs@postgresql.org; Sun, 28 Feb 2016 23:37:48 +0000 Received: from engels (162-236-13-58.lightspeed.sntcca.sbcglobal.net [162.236.13.58]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u1SNbX6Z028980 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA256 bits=128 verify=NOT); Sun, 28 Feb 2016 15:37:33 -0800 Date: Sun, 28 Feb 2016 15:37:35 -0800 From: David Gould To: junkmesend@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13994: Documentation of pg_notify is incorrect. Message-ID: <20160228153735.447d9459@engels> In-Reply-To: <20160228232040.10551.18290@wrigleys.postgresql.org> References: <20160228232040.10551.18290@wrigleys.postgresql.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYaiQW1Q85MYoQ0WpJ+EUcS8YaHnP6+uqYxowMqVWGXmlMELK16xh3d7T7TunlpFbzRkfj7UJPMRlBrEsGJReUu X-Sonic-ID: C;gB5iPXTe5RG/5k0iDwNmVA== M;gj6fPXTe5RG/5k0iDwNmVA== X-Spam-Flag: No X-Sonic-Spam-Details: 1.0/5.0 by cerberusd X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Sun, 28 Feb 2016 23:20:40 +0000 junkmesend@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 13994 > Logged by: Peter McGeeney > Email address: junkmesend@gmail.com > PostgreSQL version: 9.5.1 > Operating system: Windows 8.1 > Description: > > The documentation at > > http://www.postgresql.org/docs/9.5/static/sql-notify.html > > Recommends the command... > > SELECT pg_notify('fo' || 'o', 'pay' || 'load'); > > which doesn't work but > > PERFORM pg_notify('fo' || 'o', 'pay' || 'load'); > > does work, as explained here. > > http://stackoverflow.com/questions/5412474/using-pg-notify-in-postgresql-trigger-function?lq=1 This is working as documented. The trigger function is using language plpgsql, but the psql session is sql. SELECT works differently in plpgsql than in sql. Specifically it requires a destination for the result. Otherwise use PERFORM. See the fine manual: http://www.postgresql.org/docs/9.5/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-NORESULT -dg -- David Gould 510 282 0869 daveg@sonic.net If simplicity worked, the world would be overrun with insects. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs