Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6E1A-0004xJ-7H for pgsql-general@arkaria.postgresql.org; Thu, 13 Aug 2020 14:15:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k6E19-0005og-6K for pgsql-general@arkaria.postgresql.org; Thu, 13 Aug 2020 14:15:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6E18-0005oY-V1 for pgsql-general@lists.postgresql.org; Thu, 13 Aug 2020 14:15:42 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6E16-0007H8-Lv for pgsql-general@lists.postgresql.org; Thu, 13 Aug 2020 14:15:41 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8BF375C00E5; Thu, 13 Aug 2020 10:15:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 13 Aug 2020 10:15:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=Z LkeNWJcq8Fv2nRCoxXo9Zcta5BT51i8AqiDhCS/LjA=; b=bNOzaoXTwx7SHiViL KHe8wdCyRIVVUgahKMTOhm2F8sSX+juhkcTOB/EAv2mAusohn7Ott3gGKSmZ9qFN GSb+CUEzr6KfdYHpWSWVDXg7+SoJpM4DXZ46FjNVsQysZoY/BJRI5Eethu1fdLyj 35lMbJ0ETqqDHZezxXkRn6b+9u389Y0BIFR4LYRmJOt3lyXe2f4nuS4ZLnZ/GzBi lz+Ms30j4AGMlcmgBUbnq+DhtyIddwSWKxJoEPncDG2QrqG2kjRujpu8Z09dS/Ek FTfwtihQ17nfQ9PNR2MKDRjEewAk5cZ2M/mdRHx94bbwgtWyM7mSl5jMSZMKU6sR uEjlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=ZLkeNWJcq8Fv2nRCoxXo9Zcta5BT51i8AqiDhCS/L jA=; b=F/JMg1FP3LncTUOOwQ7V4H2w5kzgeJTi0d5H6Z8V3rtM76bZ/LkxUZNWA NDWig3kRYxZL4Td1QQqWFFPmajPSSjNSIl9WGFdHNU5MjM9Q+BwFbZUJ/KtamCLa xGRYMS0uKQHEvJfTJekEez/qdQWy3IPz7Kznokny7kkH6AWEZflBtJ74b/OTfrgy ogNglxuEr7N4PyDs2a35KqHhe1kbj+tWlaw++EDYXNIU1h4icpZmcZ2ovJV3GLMk glMKFBi0e2M3sXznhNJCs1VGWBHxqRIXIUGWJHblRTpXWie3Z0B5bGbWB4HfNgje sLKQQrwpQiAfp0W0U9WHibQPTpIHg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrleehgdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeevteejtdeike etfefhhffhteelvdekffevudegjeeukefhgfdvieeliedtkeevhfenucffohhmrghinhep phhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejhedrudejvddrhedrvdefudenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id D480E30600B2; Thu, 13 Aug 2020 10:15:38 -0400 (EDT) Subject: Re: How to export query results to excel file using psql command in postgresql To: Naveen Kumar , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <6d4ea5f4-309f-64d4-eb2c-daa7ac25ab19@aklaver.com> Date: Thu, 13 Aug 2020 07:15:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/13/20 7:10 AM, Naveen Kumar wrote: > How to export query results to excel file using psql command in postgresql You can't. You can export to CSV that you could then import into Excel. See: https://www.postgresql.org/docs/12/app-psql.html \copy -- Adrian Klaver adrian.klaver@aklaver.com