[postgresql] Export and import table dump (.sql) using pgAdmin

I have pgAdmin version 1.16.1

So, for exporting table dumm I do:

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

Then I remove table.

Ok, now I need import table backup some_name.sql into database.

How to do this? I can't find how to import table's .sql dump into database using pgAdmin.

Can you help me please?

This question is related to postgresql postgresql-9.2 pgadmin

The answer is


Using PgAdmin step 1: select schema 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 detail message copy the backup file path.

enter image description here

step 4:

Go to other schema and right click and go to Restore. (see step 1)

step 5:

In popup menu paste aboved file path to filename category and click Restore button.

enter image description here


follow he steps. in pgadmin

host-DataBase-Schemas- public (click right) CREATE script- open file -(choose xxx.sql) , then click over the option execute query write result to file -export data file ok- then click in save.its all. it work to me.

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

enter image description here


Click "query tool" button in the list of "tool".

image

And then click the "open file" image button in the tool bar.

image


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

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

Put your installed version (mine is 11).

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

and run simple query

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

enter password then wait the final console message.


Examples related to postgresql

Subtracting 1 day from a timestamp date pgadmin4 : postgresql application server could not be contacted. Psql could not connect to server: No such file or directory, 5432 error? How to persist data in a dockerized postgres database using volumes input file appears to be a text format dump. Please use psql Postgres: check if array field contains value? Add timestamp column with default NOW() for new rows only Can't connect to Postgresql on port 5432 How to insert current datetime in postgresql insert query Connecting to Postgresql in a docker container from outside

Examples related to postgresql-9.2

Postgres DB Size Command Export and import table dump (.sql) using pgAdmin Postgresql - unable to drop database because of some auto connections to DB [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified How to make a select with array contains value clause in psql Connecting PostgreSQL 9.2.1 with Hibernate Permission denied for relation PostgreSQL query to list all table names? Socket File "/var/pgsql_socket/.s.PGSQL.5432" Missing In Mountain Lion (OS X Server) Postgresql 9.2 pg_dump version mismatch

Examples related to pgadmin

How connect Postgres to localhost server using pgAdmin on Ubuntu? How should I import data from CSV into a Postgres table using pgAdmin 3? Export and import table dump (.sql) using pgAdmin Export Postgresql table data using pgAdmin PostgreSQL how to see which queries have run Postgresql: password authentication failed for user "postgres" Unable to connect PostgreSQL to remote database using pgAdmin