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 1k6E0t-0004wc-Fc for pgsql-general@arkaria.postgresql.org; Thu, 13 Aug 2020 14:15:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k6E0s-0002yM-DE for pgsql-general@arkaria.postgresql.org; Thu, 13 Aug 2020 14:15:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6E0s-0002yE-3v for pgsql-general@lists.postgresql.org; Thu, 13 Aug 2020 14:15:26 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k6E0p-00069a-Ct for pgsql-general@lists.postgresql.org; Thu, 13 Aug 2020 14:15:25 +0000 Received: by mail-ej1-x630.google.com with SMTP id jp10so6371651ejb.0 for ; Thu, 13 Aug 2020 07:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qZFEtj/wLWP8PDCe4uv+9lALb/aJlXYw/k9OTS0lr+U=; b=eUTHBueg0vHn5ZtZeAmwfZ2zVskR+gHXs1Ln2mB89EAfJ3b3+qVfttYRQHkKP4TgWL ngS1WRZI9LNFgr8yKD4cGB1GrB7RVgLU+Jkng3eNgo6e0Tb3BFf4vFazGllJIY+8DvA0 OQk8VGpIdGLYTrBBZfyaDO2S/r6gIr6IGIpn5Tl22Dgc+2+MlUkMl3fcAkgtv0KiDcP4 zzWmXXh4l+j6q1wA/JQB+4OXgTenSrojPcNra/DyZKOK4MfVKzKU72fOWlUtp8R9EM1h OJIhPqdnlT9n9kZiBvFma6r+rMIWbNtbuGwI+2vzl3Ubs+9ewjYfO1gM3sVTh5LsjCmW 7Vdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qZFEtj/wLWP8PDCe4uv+9lALb/aJlXYw/k9OTS0lr+U=; b=EjtfShT2JWVBkOXA38hoZ4bbKoDO7qXRpbBrgWYePtIMQKrWlbn0FbrcRxgoMaprBt SMSBxLIFCmp/Xr6669ItZzDcsnVa7njTV0CD+iaPC8BEjkAA8IYV39nvC8aa1HC+hmf+ JAf/1oyP8nQWA9fjhQ/1tTfK0bu8zsFfMpjVs38NdT2ONbi4NuG4leTJHjsxS76UN1rW Z6kScr8og8odonhhFwA458L/XXaY+oF4HHByWGn1iu7iAt/rwRanO5kag0ksPD/3AEDi RcpHxndLNJmB9Zcdxn5HPEwi+Ctf8jr002EJjodxLeNaQsO3Ab9vztk56bVE8R49bI08 m3uA== X-Gm-Message-State: AOAM531NN6esQYbYFjetJLIal6HSL0Lm5qRa0dFdt8h5+lggUc6OBWn8 9OS3ZJBa/lGsnX9hseJ0Dks= X-Google-Smtp-Source: ABdhPJxLohqeR1E/vWaL1qErPQWY95eYU2kz0n4oiidOVkiQGWqwqMNzgg0hqVJggFB186jcAns7xQ== X-Received: by 2002:a17:906:4acd:: with SMTP id u13mr4999037ejt.4.1597328122343; Thu, 13 Aug 2020 07:15:22 -0700 (PDT) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id w9sm4256291ejk.62.2020.08.13.07.15.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2020 07:15:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: How to export query results to excel file using psql command in postgresql From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: Date: Thu, 13 Aug 2020 16:15:21 +0200 Cc: PostgreSQL General Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Naveen Kumar X-Mailer: Apple Mail (2.3608.120.23.2.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Naveen, > On 13. Aug, 2020, at 16:10, Naveen Kumar wrote: >=20 > How to export query results to excel file using psql command in = postgresql use the "copy" command along with its CSV output setting. Then open the = CSV file with Excel. Look here: https://www.postgresqltutorial.com/export-postgresql-table-to-csv-file/ https://www.postgresql.org/docs/current/sql-copy.html Cheers, Paul=