Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkSLc-0006OM-F5 for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Oct 2015 07:44:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZkSLc-0002eT-0c for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Oct 2015 07:44:12 +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 1ZkSLb-0002dn-5R for pgsql-bugs@postgresql.org; Fri, 09 Oct 2015 07:44:11 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZkSLT-0002VW-Up for pgsql-bugs@postgresql.org; Fri, 09 Oct 2015 07:44:10 +0000 MIME-Version: 1.0 Subject: BUG #13671: pg_terminate_backend(pid) does not work To: pgsql-bugs@postgresql.org From: oktogen@mail.ru Date: Fri, 09 Oct 2015 07:43:34 +0000 Message-ID: <20151009074334.1217.18732@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: 13671 Logged by: alex Email address: oktogen@mail.ru PostgreSQL version: 9.4.5 Operating system: ubuntu Description: The command pg_terminate_backend(pid) does not terminate sql session in case incorrect formed COPY command(without terminate-symbol) Example --SESSION #1 CREATE TABLE public.comments ( user_id INTEGER NOT NULL, description TEXT NOT NULL, path public.ltree NOT NULL, CONSTRAINT comments_idx PRIMARY KEY(user_id, description, path) )WITHOUT OIDS; COPY comments (user_id, description, path) FROM stdin; 1 efbb974bcf5af8f2ba8f352225ecff63 0001 2 8dcdb42684773f413b40d63f5ef0722e 0001.0001.0001 -- --SESSION #2 -- Now SESSION # 1 can not be forced to complete the outside. -- learn pid process which need terminate SELECT a.pid, a.usename, a.application_name, a.client_addr, clock_timestamp() - a.query_start AS duration, a.state, a.query, a.waiting FROM pg_stat_activity a; --attempt to finish the session with incorrect COPY command SELECT pg_terminate_backend(6476) AS output; -- output ------------- -- TRUE SELECT a.pid, a.state, a.query FROM pg_stat_activity a WHERE a.pid = 6476; -- output(failed attempt) +-----+--------+---------------------------------------------------------+ | pid | state | query | +-----+--------+---------------------------------------------------------+ |6476 | active | COPY comments (user_id, description, path) FROM stdin; | +-----+--------+---------------------------------------------------------+ -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs