Import PostgreSQL data
The next step is to import the PostgreSQL data into YugabyteDB.
NoteAfter the data import step, remember to recreate any constraints and triggers that might have been disabled to speed up loading the data. This would ensure that the database will perform relational integrity checking for data going forward.
Import a database
To import an entire database from a
ysql_dump export, use
ysqlsh. The command should look as shown below.
$ ysqlsh -f <db-sql-script>
ysqlshtool is a derivative of the PostgreSQL tool,
psqlcommands would work in
Import a table using COPY FROM
Importing a single table (or a partial export from a table) can be done by running the COPY FROM command, and providing it the location of the export file prepared in a previous step. This should look as shown below.
COPY country FROM 'export.csv';