Re: import .sql file into PostgreSQL database

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Gaurav Jindal <gaurjin(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: import .sql file into PostgreSQL database
Date: 2014-04-08 11:32:00
Message-ID: 5343DE30.7060306@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/04/2014 04:47, Michael Paquier wrote:
> On Tue, Apr 8, 2014 at 12:33 PM, Gaurav Jindal <gaurjin(at)gmail(dot)com> 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(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2014-04-08 11:32:53 Re: public schema owner for newly created database
Previous Message Alberto Cabello Sánchez 2014-04-08 11:05:11 Re: public schema owner for newly created database