Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XfEW4-00044A-S3 for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Oct 2014 20:52:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XfEW3-0004TP-FZ for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Oct 2014 20:52:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XfAJ1-0005Nb-Qn for pgsql-bugs@postgresql.org; Fri, 17 Oct 2014 16:23:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XfAIw-0005od-RY for pgsql-bugs@postgresql.org; Fri, 17 Oct 2014 16:23:06 +0000 MIME-Version: 1.0 Subject: BUG #11703: ERROR: variable not found in subplan target list To: pgsql-bugs@postgresql.org From: karl.bartel@adspert.de Date: Fri, 17 Oct 2014 16:22:36 +0000 Message-ID: <20141017162236.2523.74453@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.2 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 11703 Logged by: Karl Bartel Email address: karl.bartel@adspert.de PostgreSQL version: 9.3.5 Operating system: Mac OS X Description: The above error occurs when I execute CREATE TABLE my_table ( my_column text ); CREATE OR REPLACE FUNCTION func1(tab my_table) RETURNS int AS $$ SELECT CASE tab.my_column WHEN 'foobar' THEN 1 END $$ LANGUAGE sql IMMUTABLE; CREATE OR REPLACE FUNCTION func2( tab my_table ) RETURNS TABLE(ret1 int) AS $$ SELECT func1(tab) $$ LANGUAGE sql IMMUTABLE; SELECT 1 FROM my_table, func2(my_table); I can reproduce this with the postgres.app on OS 10.8.5: PostgreSQL 9.3.5 on x86_64-apple-darwin13.3.0, compiled by Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn), 64-bit And on my debian machine: PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs