Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a schema sql file using pgadmin 4?

Is it possible? If so how?

I can only find solution for pgadmin 3 which doesn't work for me.

like image 857
Chris Stryczynski Avatar asked Jul 27 '18 22:07

Chris Stryczynski


People also ask

How do you add a schema in pgAdmin?

Use the fields on the General tab to identify the schema. Use the Name field to add a descriptive name for the schema. The name will be displayed in the pgAdmin tree control. Select the owner of the schema from the drop-down listbox in the Owner field.

How can I import the schema of a database in PostgreSQL?

The phpPgAdmin administration page appears in a new window. In the left pane of the phpPgAdmin window, expand Servers, expand PostgreSQL, and then click the name of the database that you want to import the data into. On the top menu bar, click SQL. The SQL link is located between the Schemas and Find links.

How do you select a schema in pgAdmin?

Schemas in PGAdminThe “Properties” tab in the right top of the interface will display all of the extra properties that the information_schema holds on the table or column including default values, data type, and more.


2 Answers

Following are the step that will help you in importing all tables of your schema

1) Open pgAdmin 4

2) Navigate to Your Database Name --> Schemas --> public

3) Then right click on public

4) After clicking on public then select Restore option from DropDown Menu

5) A window will open in which you only have to give location of .sql file and leave other textboxes

6) Click Restore and leave rest on pgadmin

Note : You have to perform these steps for every single table you want to import

like image 38
ShehrozEK Avatar answered Nov 02 '22 18:11

ShehrozEK


It worked like this for me:

  1. Go to your Database and click on this.
  2. Click in the menubar on Tools, Query Tools

enter image description here

  1. Then it reload the page. Above the menubar on the left, you see the folder-icon (look picture below). Click on them and choose your .sql file
  2. Click on select and the file is uploaded
  3. To execute the .sql file, press F5 or the play button above the menubar in the middle (look at the screenshot below).
  4. Right click on your database and click on 'Refresh'.

enter image description here

like image 132
SwissCodeMen Avatar answered Nov 02 '22 19:11

SwissCodeMen