pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: How do I import a sql file into pgAdmin4 ?
Date: Mon, 15 Jul 2019 13:50:00 +0200
Message-ID: <020095b4-0622-15d5-c1e8-60df44918fc4@jakobs.com> (raw)
In-Reply-To: <325397478.730265.1563181161656@mail.yahoo.com>
References: <1586344675.694544.1563168420153@mail.yahoo.com>
	<81AFFC3D-FD7B-4C11-93EE-210A8B1C752D@jakobs.com>
	<325397478.730265.1563181161656@mail.yahoo.com>

Hi Karen,

all frontends ask for a password if the combination of hostname, user,
database needs one, unless you save it in the .pgpass or
%APPDATA%\postgresql\pgpass.conf file.

Your command

    psql -U postgres -d mydb -a -f "Filelocation\name"

lacks a host to connect to. If the database is running on the same
system, add the option -h localhost.

Using the username postgres is generally not a good idea, set up an
ordinary user, create a database for that user and use those. The name
of the user and database may be identical, but doesn't have to.

After downloading PostgreSQL (if for Windows, it should be the one by
EDB) it has to be installed. I don't think there is a pure client
installer available for Windows, though.

Regards,

Holger

Am 15.07.19 um 10:59 schrieb Karen Goh:
>
>
>
> Hi Hoger,
>
> I tried as you said. I downloaded this psql - postgres frontend for
> windows and then tried pg_dump as well as psql command prompt.
>
> But, they asked me for password.
>
> May I know what kind of password it is referring to ?
>
> When I downloaded POSTGRESQL, it is saved in the program files in
> windows 10 but there isn't any command line tool available.
> I tried using windows 10 command prompt but it is not accepting any
> command like I what type :
> psql -U postgres -d mydb -a -f "Filelocation\name"
>
> Please help.
>
> Thanks.
> On Monday, July 15, 2019, 1:32:08 PM GMT+8, Holger Jakobs
> <holger@jakobs.com> wrote:
>
>
> The easiest way would be using psql on the command line.
>
> Dump a little database using pg_dump with the option --data-only to
> see what the format digestible by psql looks like.
>
> Basically, it's a COPY command followed by the data in tab-separated
> format finished by a line consisting of a backslash and a period.  \.
>
>
>
> Am 15. Juli 2019 07:27:00 MESZ schrieb Karen Goh <karenworld@yahoo.com
> <mailto:karenworld@yahoo.com>>:
> >Hi,
> >
> >I need to migrate to postgreSQL using SQL flat files which contains a
> >few thousands rows of data.
> >
> >So far, I have attempted but not successful.  Not sure if it can't be
> >done using pgAdmin4.
> >
> >And posting to Stackoverflow superUser doesn't help as there is no
> >reply at all.
> >
> >Hence, I hope to get some help here.
> >
> >Thanks & regards,
> >Karen
>
>
> -- 
> Holger Jakobs, Bergisch Gladbach
> +49 178 9759012
> - sent from mobile, therefore short -
>
>
-- 

Holger Jakobs, Bergisch Gladbach
instant messaging: xmpp:holger@jakobs.com
+49 178 9759012 <tel:+491789759012> oder +49 2202 817157
<tel:+492202817157>

view thread (11+ messages)  latest in thread

Message-ID: <020095b4-0622-15d5-c1e8-60df44918fc4@jakobs.com>
Permalink:  ../020095b4-0622-15d5-c1e8-60df44918fc4@jakobs.com/
Also on:    postgresql.org/message-id/020095b4-0622-15d5-c1e8-60df44918fc4@jakobs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: How do I import a sql file into pgAdmin4 ?
  In-Reply-To: <020095b4-0622-15d5-c1e8-60df44918fc4@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox