Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbJVR-0007pL-RU for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Oct 2013 00:19:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VbJVR-0006IP-2b for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Oct 2013 00:19:29 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbJVP-0006Ge-EW for pgsql-bugs@postgresql.org; Wed, 30 Oct 2013 00:19:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbJVN-0004tL-Hk for pgsql-bugs@postgresql.org; Wed, 30 Oct 2013 00:19:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id r9U0JN7Z013625; Tue, 29 Oct 2013 20:19:23 -0400 From: Tom Lane To: joshuadburns@hotmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8568: PLPGSQL Documentation For CASE Is incorrect In-reply-to: References: Comments: In-reply-to joshuadburns@hotmail.com message dated "Wed, 30 Oct 2013 00:07:37 -0000" Date: Tue, 29 Oct 2013 20:19:23 -0400 Message-ID: <13624.1383092363@sss.pgh.pa.us> X-Pg-Spam-Score: -0.5 (/) 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 joshuadburns@hotmail.com writes: > Every example within the PLPGSQL "control structures" documentation states > that the proper syntax for closing a "CASE" statement is to use "END CASE;" Which it is. > ===================================== > Example CASE statement with END CASE; > ------------------------------------- > DO LANGUAGE "plpgsql" $BODY$ > DECLARE my_var INTEGER := 2; BEGIN > RAISE NOTICE > '%', > CASE > WHEN my_var = 1 THEN 'one' > WHEN my_var = 2 THEN 'two' > WHEN my_var = 3 THEN 'three' > END CASE; > END $BODY$; This is not a case statement, it's a case expression (used within a RAISE statement). That's documented under the main SQL grammar, and there you just say END. Yeah, I know it's not terribly consistent. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs