Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 15EE51337B92 for ; Thu, 5 May 2011 06:34:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 42917-07 for ; Thu, 5 May 2011 09:34:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id F39321337B82 for ; Thu, 5 May 2011 06:34:44 -0300 (ADT) Received: by fxm17 with SMTP id 17so1396152fxm.19 for ; Thu, 05 May 2011 02:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=1N4zNW2+2Fe05U3hWB/38mfSvhLsT8Y9pTwe1s1W16A=; b=NaFCAsQMZuPEEGt37D1njqj1BZxz3qIPimEsMc613/1GJ/n1i8NOPcE+NfmjTASIvI c1sIK0o8hspFa8fsOURhkglin2HmhOP/UXABvJOP1EJwOVByvUDQUKifYdvbJcTZlJ/D 0tgnkRNJYlWDjiTxWVnl5yq1aUCq2cViZSo8o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=hSid16tai3cJS+B8q/9bYaXwsXZbuUhPqdy6vAEVfChLdLi3bSK+HxzzUuA4Ov9rZR mR29/kIzofoQH/0U9TcOz5t2UWDKR6hjafBjn5lOWRNej6t1p+w8ktJvHc0viM9hKUCx 0df4nUa1o0j5GanTSPRaMyQ/KCyCTbJCLd2C8= Received: by 10.223.17.142 with SMTP id s14mr2441766faa.145.1304588084263; Thu, 05 May 2011 02:34:44 -0700 (PDT) Received: from [172.20.20.236] (fw.nic.cz [217.31.207.1]) by mx.google.com with ESMTPS id g5sm682863faa.26.2011.05.05.02.34.43 (version=SSLv3 cipher=OTHER); Thu, 05 May 2011 02:34:43 -0700 (PDT) Message-ID: <4DC26F32.70409@gmail.com> Date: Thu, 05 May 2011 11:34:42 +0200 From: Jiri Sadek User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110419 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: psql command line client behaviour Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/16 X-Sequence-Number: 30155 I was told about behaviour of psql command line client that seems as bug to me. When I am connected to server (cmdline client, interactive mode) and server is restarted next query fails and client try to reconnect to server. Problem arise when I send more queries (not speaking that this may not be a good habit) at once - on first one client detects that connection is lost and try to reconnect and then rest of queries are executed (but not the first one). This can have bad consequences (e.g. if first query is BEGIN;): sample (postgresql 8.3.15): (test@[local:/var/opt/testdb/pg_sockets]:20000) 10:55:34 [testdb] #> select 10; select 20; ?column? ---------- 10 (1 row) Time: 0.142 ms ?column? ---------- 20 (1 row) Time: 0.039 ms (test@[local:/var/opt/testdb/pg_sockets]:20000) 10:55:42 [testdb] #> select 10; select 20; FATAL: terminating connection due to administrator command server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Succeeded. ?column? ---------- 20 (1 row) Time: 0.193 ms I would suggest to not execute any query or all of them after reconnect. Jiri