Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwFcC-0004RX-Gs for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Nov 2015 20:34:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZwFcC-0006as-3E for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Nov 2015 20:34:04 +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 1ZwCtq-0008Jl-DO for pgsql-bugs@postgresql.org; Tue, 10 Nov 2015 17:40:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZwCtn-0005x0-Sl for pgsql-bugs@postgresql.org; Tue, 10 Nov 2015 17:40:05 +0000 MIME-Version: 1.0 Subject: BUG #13767: EXECUTE querytext USING value1, value2, value3 (Edge case?) To: pgsql-bugs@postgresql.org From: needthistool@gmail.com Date: Tue, 10 Nov 2015 17:39:35 +0000 Message-ID: <20151110173935.2577.7423@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" 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: 13767 Logged by: Seldom Email address: needthistool@gmail.com PostgreSQL version: 9.2.14 Operating system: Linux 4.1.10-17.31.amzn1.x86_64 #1 (~RHEL 4.8.3-9) Description: -- Attempt to run the following on any database, no setup necessary. -- Creating relations with the correct names etc. should not be needed, -- as the error occurs before the system has a chance to find any relations absent. -- The code below fails *in an unexpected way* because no substitution appears to take place. -- The correct behavior would be to throw an error stating that only INSERT, UPDATE, DELETE, -- and SELECT (DML) statements should be used in combination with the EXECUTE ... USING construct, -- perhaps recommending that FORMAT function be used instead. -- -- ERROR: syntax error at or near "$1" -- LINE 3: special_constraint_trigger($1,$2,$3); -- ^ -- SQL state: 42601 -- Context: PL/pgSQL function inline_code_block line 11 at EXECUTE statement -- DO LANGUAGE plpgsql $$ DECLARE -- simulated parameters: referencing_table TEXT = 'the_great_referencer'; referencing_column TEXT = 'fk_field'; referenced_column TEXT = 'measurement_id'; -- :simulated parameters BEGIN EXECUTE 'CREATE CONSTRAINT TRIGGER except_if_changes_break_references_77 AFTER UPDATE OR DELETE ON measurement_unit DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE PROCEDURE special_constraint_trigger($1,$2,$3);' USING referenced_column,referencing_table, referencing_column; END; $$; -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs