Export and import dump table (.sql) using pgAdmin

I have pgAdmin version 1.16.1

So, to export the dumm table, I do:

Right-click on the table, then click backup in the menu, then in Format select Plain and save the file as some_name.sql

Then I delete the table.

Ok, now I need a backup of the import table some_name.sql to the database.

How to do it? I cannot find how to import a .sql table into a database using pgAdmin.

Can you help me?

+74
postgresql pgadmin
Sep 11 '13 at 8:35 on
source share
6 answers
  • In pgAdmin, select the desired target schema in the object tree
  • Click on PSQL Plugins / Console
  • Write \i /path/to/yourfile.sql
  • Press enter
+131
Sep 11 '13 at 9:13
source share

follow him. in pgadmin

host-DataBase-Schemas-public (right-click) CREATE script- open file - (select xxx.sql), then click on the option to query the write request to the data file -export ok-, then click on save.its all. it works for me.

note: an error in the command script version enter the image description here de sql over pgadmin can be found, example: http://www.forosdelweb.com/f21/campo-tipo-datetime-postgresql-245389/

enter image description here

+5
Mar 08 '16 at 7:47
source share

Using PgAdmin, step 1: select the scheme and right-click and go to Backup. enter image description here

step 2: give the file name and click the backup button.

enter image description here

Step 3: In the detailed message, copy the path to the backup file.

enter image description here

step 4:

Switch to another diagram and right-click and go to Restore. (see step 1)

step 5:

In the pop-up menu, insert the above path to the file and click the "Restore" button.

enter image description here

+4
Feb 14 '18 at 6:26
source share

If you have Git bash installed, you can do something like this:

 /c/Program\ Files\ \(x86\)/PostgreSQL/9.3/bin/psql -U <pg_role_name> -d <pg_database_name> < <path_to_your>.sql 
+2
Dec 02 '16 at 19:39
source share

Click the Request Tool button in the Tool list.

image

And then click the button with the image โ€œopen fileโ€ on the toolbar.

image

+1
Mar 08 '18 at 7:09
source share

In another way, you can do it easily with CMD on Windows

Install the installed version (I have 11).

 cd C:\Program Files\PostgreSQL\11\bin\ 

and run a simple query

 psql -U <postgre_username> -d <db_name> < <C:\path\data_dump.sql> 

enter the password and wait for the last console message.

0
Apr 04 '19 at 15:29
source share



All Articles