Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXUGK-0002wT-HW for pgsql-general@arkaria.postgresql.org; Tue, 08 Apr 2014 11:32:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXUGK-0006ky-0d for pgsql-general@arkaria.postgresql.org; Tue, 08 Apr 2014 11:32:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXUGI-0006kn-ME for pgsql-general@postgresql.org; Tue, 08 Apr 2014 11:32:18 +0000 Received: from teladesign.vm.bytemark.co.uk ([89.16.172.204]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXUGA-0005sa-UN for pgsql-general@postgresql.org; Tue, 08 Apr 2014 11:32:18 +0000 Received: from [93.107.231.214] (helo=[127.0.0.1]) by teladesign.vm.bytemark.co.uk with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1WXUG9-0002As-6H; Tue, 08 Apr 2014 12:32:09 +0100 Message-ID: <5343DE30.7060306@iol.ie> Date: Tue, 08 Apr 2014 12:32:00 +0100 From: Raymond O'Donnell Reply-To: rod@iol.ie User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Michael Paquier , Gaurav Jindal CC: PostgreSQL mailing lists Subject: Re: import .sql file into PostgreSQL database References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 140407-0, 07/04/2014), Outbound message X-Antivirus-Status: Clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 08/04/2014 04:47, Michael Paquier wrote: > On Tue, Apr 8, 2014 at 12:33 PM, Gaurav Jindal wrote: >> How to import the .sql file using PSQL or PgAdmin? Can anyone guide me with >> details and step by step instructions. >> >> I tried \i filename.sql command but permission denied. I don't know how to >> make it work. Can anyone helps me out. Thanks! > As you mentionned "¥i $FILE" (as is psql -f $FILE) is just fine, as > you are getting a permission error just be sure that the user that is > using the client application has a read access to the sql file you are > trying to use. Where is the "Permission denied" coming from? - the OS, or Postgres? Check, in addition to the above, that the Postgres user you're using for the connection has the requisite INSERT, SELECT (etc) permissions on the database objects. Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general