pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHow do I import a sql file into pgAdmin4 ?
11+ messages / 4 participants
[nested] [flat]
* How do I import a sql file into pgAdmin4 ?
@ 2019-07-15 05:27 Karen Goh <karenworld@yahoo.com>
0 siblings, 1 reply; 11+ messages in thread
From: Karen Goh @ 2019-07-15 05:27 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-15 05:31 Holger Jakobs <holger@jakobs.com>
parent: Karen Goh <karenworld@yahoo.com>
0 siblings, 2 replies; 11+ messages in thread
From: Holger Jakobs @ 2019-07-15 05:31 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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>:
>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 -
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-15 06:49 nikhil raj <nikhilraj474@gmail.com>
parent: Holger Jakobs <holger@jakobs.com>
1 sibling, 0 replies; 11+ messages in thread
From: nikhil raj @ 2019-07-15 06:49 UTC (permalink / raw)
To: Holger Jakobs <holger@jakobs.com>; +Cc: pgsql-admin@lists.postgresql.org
HI,
If you are migrate through PSQL shell by using \i and the path.
* Note before restoring connect to the databases and migrate it.
On Mon, Jul 15, 2019 at 11:02 AM 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>:
> >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 -
>
>
>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-15 08:59 Karen Goh <karenworld@yahoo.com>
parent: Holger Jakobs <holger@jakobs.com>
1 sibling, 2 replies; 11+ messages in thread
From: Karen Goh @ 2019-07-15 08:59 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org, Holger Jakobs <holger@jakobs.com>
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>:
>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 -
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-15 11:50 Holger Jakobs <holger@jakobs.com>
parent: Karen Goh <karenworld@yahoo.com>
1 sibling, 0 replies; 11+ messages in thread
From: Holger Jakobs @ 2019-07-15 11:50 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-15 13:44 Holger Jakobs <holger@jakobs.com>
parent: Karen Goh <karenworld@yahoo.com>
1 sibling, 1 reply; 11+ messages in thread
From: Holger Jakobs @ 2019-07-15 13:44 UTC (permalink / raw)
To: Karen Goh <karenworld@yahoo.com>; pgsql-admin@lists.postgresql.org
Hi Kargen,
The password is the one which was set for the respective user (here:
postgres) in the database backend.
A fresh installation typically has only one user role named postgres.
The password is asked for during the installation (in case of Windows).
On Linux servers the role has no password, but is authenticated by peer,
which means that you connect from a session on the database server
locally to the database.
After installing the EDB Postgres database on Windows, you have to start
the client programs with their complete path or add the directory where
they reside (typically C:\Program Files\Postgresql\versionNumber\bin) to
the environment variable %PATH%. Please check with your system
administrators on how to do this.
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>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-19 12:29 Karen Goh <karenworld@yahoo.com>
parent: Holger Jakobs <holger@jakobs.com>
0 siblings, 1 reply; 11+ messages in thread
From: Karen Goh @ 2019-07-19 12:29 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org, Holger Jakobs <holger@jakobs.com>
On Monday, July 15, 2019, 9:44:24 PM GMT+8, Holger Jakobs <holger@jakobs.com> wrote:
Hi Kargen,
The password is the one which was set for the respective user (here: postgres) in the database backend.
A fresh installation typically has only one user role named postgres. The password is asked for during the installation (in case of Windows). On Linux servers the role has no password, but is authenticated by peer, which means that you connect from a session on the database server locally to the database.
After installing the EDB Postgres database on Windows, you have to start the client programs with their complete path or add the directory where they reside (typically C:\Program Files\Postgresql\versionNumber\bin) to the environment variable %PATH%. Please check with your system administrators on how to do this.
OK. Now I found my password from my notebook.
Using Windows 10 command prompt, the error said it can't find that file but the fileName everything was correct.
Is there anything wrong with that query?
I also read this thread but I can't find any file open to get pgAdmin4 to open my file.
https://www.postgresql.org/message-id/287946147.391841.1515085145687%40mail.yahoo.com
Please advise.
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>:
>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 oder +49 2202 817157
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-19 13:51 Gopi Setty <gsp06268@gmail.com>
parent: Karen Goh <karenworld@yahoo.com>
0 siblings, 2 replies; 11+ messages in thread
From: Gopi Setty @ 2019-07-19 13:51 UTC (permalink / raw)
To: Karen Goh <karenworld@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org, Holger Jakobs <holger@jakobs.com>
1. Simple file import method (Right-click in table and import/export option)
[image: image.png]
2. If you are using pg-admin-III right-click on the PSQL consloe option or
Linux server use a copy command \COPY tmp_test FROM 'test.csv' DELIMITER
',' CSV HEADER ;
[image: image.png]
On Fri, Jul 19, 2019 at 7:29 AM Karen Goh <karenworld@yahoo.com> wrote:
>
>
>
>
>
> On Monday, July 15, 2019, 9:44:24 PM GMT+8, Holger Jakobs <
> holger@jakobs.com> wrote:
>
>
> Hi Kargen,
>
> The password is the one which was set for the respective user (here:
> postgres) in the database backend.
>
> A fresh installation typically has only one user role named postgres. The
> password is asked for during the installation (in case of Windows). On
> Linux servers the role has no password, but is authenticated by peer, which
> means that you connect from a session on the database server locally to the
> database.
>
> After installing the EDB Postgres database on Windows, you have to start
> the client programs with their complete path or add the directory where
> they reside (typically C:\Program Files\Postgresql\versionNumber\bin) to
> the environment variable %PATH%. Please check with your system
> administrators on how to do this.
>
>
> OK. Now I found my password from my notebook.
>
> Using Windows 10 command prompt, the error said it can't find that file
> but the fileName everything was correct.
> Is there anything wrong with that query?
>
> I also read this thread but I can't find any file open to get pgAdmin4 to
> open my file.
>
>
>
> https://www.postgresql.org/message-id/287946147.391841.1515085145687%40mail.yahoo.com
>
> Please advise.
>
> 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>:
> >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 oder +49 2202 817157
>
Attachments:
image.png (image/png, 127.7K) download
view image
image.png (image/png, 55.0K) download
view image
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-19 14:06 Karen Goh <karenworld@yahoo.com>
parent: Gopi Setty <gsp06268@gmail.com>
1 sibling, 1 reply; 11+ messages in thread
From: Karen Goh @ 2019-07-19 14:06 UTC (permalink / raw)
To: Gopi Setty <gsp06268@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org, Holger Jakobs <holger@jakobs.com>
On Friday, July 19, 2019, 9:52:42 PM GMT+8, Gopi Setty <gsp06268@gmail.com> wrote:
1. Simple file import method (Right-click in table and import/export option)
image.png
2. If you are using pg-admin-III right-click on the PSQL consloe option or Linux server use a copy command \COPY tmp_test FROM 'test.csv' DELIMITER ',' CSV HEADER ;
image.png
Thanks Gopi. However, I am getting the below error.
ERROR: extra data after last expected column
CONTEXT: COPY dbMembershipparticulars, line 1: "-- phpMyAdmin SQL Dump"
How do I resolve this error ?
Unfortunately, I am not using Linux server...and just make use of whatever iH ave which is Windows 10:(
On Fri, Jul 19, 2019 at 7:29 AM Karen Goh <karenworld@yahoo.com> wrote:
On Monday, July 15, 2019, 9:44:24 PM GMT+8, Holger Jakobs <holger@jakobs.com> wrote:
Hi Kargen,
The password is the one which was set for the respective user (here: postgres) in the database backend.
A fresh installation typically has only one user role named postgres. The password is asked for during the installation (in case of Windows). On Linux servers the role has no password, but is authenticated by peer, which means that you connect from a session on the database server locally to the database.
After installing the EDB Postgres database on Windows, you have to start the client programs with their complete path or add the directory where they reside (typically C:\Program Files\Postgresql\versionNumber\bin) to the environment variable %PATH%. Please check with your system administrators on how to do this.
OK. Now I found my password from my notebook.
Using Windows 10 command prompt, the error said it can't find that file but the fileName everything was correct.
Is there anything wrong with that query?
I also read this thread but I can't find any file open to get pgAdmin4 to open my file.
https://www.postgresql.org/message-id/287946147.391841.1515085145687%40mail.yahoo.com
Please advise.
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>:
>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 oder +49 2202 817157
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-19 14:11 Gopi Setty <gsp06268@gmail.com>
parent: Karen Goh <karenworld@yahoo.com>
0 siblings, 0 replies; 11+ messages in thread
From: Gopi Setty @ 2019-07-19 14:11 UTC (permalink / raw)
To: Karen Goh <karenworld@yahoo.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org
Looks like you have additional columns,
Take the file header and created temp table and load to temp to temp table
first.
Create temp table test(< allcolumns list > <text data type >)
On Fri, Jul 19, 2019 at 9:07 AM Karen Goh <karenworld@yahoo.com> wrote:
>
>
>
>
>
> On Friday, July 19, 2019, 9:52:42 PM GMT+8, Gopi Setty <gsp06268@gmail.com>
> wrote:
>
>
> 1. Simple file import method (Right-click in table and import/export
> option)
>
> image.png
>
> 2. If you are using pg-admin-III right-click on the PSQL consloe option or
> Linux server use a copy command \COPY tmp_test FROM 'test.csv' DELIMITER
> ',' CSV HEADER ;
>
> image.png
>
> Thanks Gopi. However, I am getting the below error.
>
> ERROR: extra data after last expected column
> CONTEXT: COPY dbMembershipparticulars, line 1: "-- phpMyAdmin SQL Dump"
> How do I resolve this error ?
>
> Unfortunately, I am not using Linux server...and just make use of whatever
> iH ave which is Windows 10:(
>
>
>
> On Fri, Jul 19, 2019 at 7:29 AM Karen Goh <karenworld@yahoo.com> wrote:
>
>
>
>
>
>
> On Monday, July 15, 2019, 9:44:24 PM GMT+8, Holger Jakobs <
> holger@jakobs.com> wrote:
>
>
> Hi Kargen,
>
> The password is the one which was set for the respective user (here:
> postgres) in the database backend.
>
> A fresh installation typically has only one user role named postgres. The
> password is asked for during the installation (in case of Windows). On
> Linux servers the role has no password, but is authenticated by peer, which
> means that you connect from a session on the database server locally to the
> database.
>
> After installing the EDB Postgres database on Windows, you have to start
> the client programs with their complete path or add the directory where
> they reside (typically C:\Program Files\Postgresql\versionNumber\bin) to
> the environment variable %PATH%. Please check with your system
> administrators on how to do this.
>
>
> OK. Now I found my password from my notebook.
>
> Using Windows 10 command prompt, the error said it can't find that file
> but the fileName everything was correct.
> Is there anything wrong with that query?
>
> I also read this thread but I can't find any file open to get pgAdmin4 to
> open my file.
>
>
>
> https://www.postgresql.org/message-id/287946147.391841.1515085145687%40mail.yahoo.com
>
> Please advise.
>
> 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>:
> >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 oder +49 2202 817157
>
>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: How do I import a sql file into pgAdmin4 ?
@ 2019-07-19 14:13 Karen Goh <karenworld@yahoo.com>
parent: Gopi Setty <gsp06268@gmail.com>
1 sibling, 0 replies; 11+ messages in thread
From: Karen Goh @ 2019-07-19 14:13 UTC (permalink / raw)
To: Gopi Setty <gsp06268@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org, Holger Jakobs <holger@jakobs.com>
On Friday, July 19, 2019, 9:52:42 PM GMT+8, Gopi Setty <gsp06268@gmail.com> wrote:
1. Simple file import method (Right-click in table and import/export option)
image.png
Hi Gopi,
Further to my last message regarding the error, can I know if I have to create the columns before I import or just the table will do ?
Now, I tried using csv format file, still receiving the same error :
error extra data after last expected column
2. If you are using pg-admin-III right-click on the PSQL consloe option or Linux server use a copy command \COPY tmp_test FROM 'test.csv' DELIMITER ',' CSV HEADER ;
image.png
On Fri, Jul 19, 2019 at 7:29 AM Karen Goh <karenworld@yahoo.com> wrote:
On Monday, July 15, 2019, 9:44:24 PM GMT+8, Holger Jakobs <holger@jakobs.com> wrote:
Hi Kargen,
The password is the one which was set for the respective user (here: postgres) in the database backend.
A fresh installation typically has only one user role named postgres. The password is asked for during the installation (in case of Windows). On Linux servers the role has no password, but is authenticated by peer, which means that you connect from a session on the database server locally to the database.
After installing the EDB Postgres database on Windows, you have to start the client programs with their complete path or add the directory where they reside (typically C:\Program Files\Postgresql\versionNumber\bin) to the environment variable %PATH%. Please check with your system administrators on how to do this.
OK. Now I found my password from my notebook.
Using Windows 10 command prompt, the error said it can't find that file but the fileName everything was correct.
Is there anything wrong with that query?
I also read this thread but I can't find any file open to get pgAdmin4 to open my file.
https://www.postgresql.org/message-id/287946147.391841.1515085145687%40mail.yahoo.com
Please advise.
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>:
>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 oder +49 2202 817157
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2019-07-19 14:13 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 05:27 How do I import a sql file into pgAdmin4 ? Karen Goh <karenworld@yahoo.com>
2019-07-15 05:31 ` Holger Jakobs <holger@jakobs.com>
2019-07-15 06:49 ` nikhil raj <nikhilraj474@gmail.com>
2019-07-15 08:59 ` Karen Goh <karenworld@yahoo.com>
2019-07-15 11:50 ` Holger Jakobs <holger@jakobs.com>
2019-07-15 13:44 ` Holger Jakobs <holger@jakobs.com>
2019-07-19 12:29 ` Karen Goh <karenworld@yahoo.com>
2019-07-19 13:51 ` Gopi Setty <gsp06268@gmail.com>
2019-07-19 14:06 ` Karen Goh <karenworld@yahoo.com>
2019-07-19 14:11 ` Gopi Setty <gsp06268@gmail.com>
2019-07-19 14:13 ` Karen Goh <karenworld@yahoo.com>
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