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?
In the left pane of the phpPgAdmin window, expand Servers, expand PostgreSQL, and then click the name of the database that you want to export. On the top menu bar, click Export. Under Format, click Structure and data. Under Options, in the Format list box, select SQL.
To import SQL script file into PostgreSQL database using this tool, take the following steps: Select the database. Navigate to the "SQL" button. Click the "Choose File" (or "Browse") button and select the SQL file from your computer.
\i /path/to/yourfile.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.
Note: Make sure to remove <> from the above query except for the < between db_name & file path.
Example: psql -U postgres -d dumb_db < D:\db_dump.sql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With