Rather than manually adding source tables by entering details such as schema_name, table_name, and specifying all columns with their types individually, you can streamline the process by importing them all at once using pg_dump for multiple tables.
On the source table creation page, you can choose the "Import Source Tables" option. This opens the file explorer, allowing you to select a dump file. After selecting the file, all the source tables contained within it will be uploaded automatically.
Prerequisites:
1. Open up a terminal.
2.1. Run the following command to export all tables in the database schema:
pg_dump --schema-only -U <user> -h <host> -p <port> -d <database_name> > <directory\filename.sql>
Example:
pg_dump --schema-only -U postgres.user -h aws-0-eu-central.com -p 6543 -d postgres > C:\Users\User\Desktop\dump.sql
This command generates a dump file containing the schema for all tables and saves it to the specified location (e.g., the Desktop on a Windows machine).
2.2. To export specific tables only, use the --table flag. You can specify multiple tables by repeating the flag.
pg_dump --schema-only -U <user> -h <host> -p <port> -d <database_name> --table=<schema_name.table_name> ><directory\filename.sql>
Example:
pg_dump --schema-only -U postgres.user -h aws-0-eu-central.com -p 6543 -d postgres --table=public.books --table=public.authors > C:\Users\User\Desktop\dump.sql
This command creates a dump file containing only the specified tables (e.g., books and authors in the public schema).
1. Open up a pgAdmin.
2. Register a Postgresql server by pressing register -> server. Then fill in all the connection details in the modal.
3. After registering the server, you will see it listed along with the associated database (in this example, postgres). Right-click on the database and select the "Backup" option from the menu.
4. In the General tab, choose the location where you'd like to save the dump file, set the format to "Plain", and select UTF8 as the encoding.
5. In the Data Options tab, select the "Only Schemas" option and ensure the "Blobs" toggle is turned off.
6. In the Options tab, turn off the "Verbose Messages" toggle to disable detailed output.
7. (Optional) If you want to export specific tables only, navigate to the Objects tab and select the tables you wish to include in the export.
8. Click "Backup" and wait for the dump file to be generated. Once the process is complete, you can find the file in the location specified in Step 4. This file can then be used in the Provably GUI to import all the source tables.