I am trying to import my schema.sql file of old DB to newly created Db in postgresql.
Could you please let me know the steps i need to follow to do this.
Env : linux centos 7 DB : postgresql 9.3 I have copied schema.sql file in directory /var/lib/pgsql/9.4/data/.
Regards.
you can directly execute the sql file using psql to create the schema in your new db:
psql -f schemadump.sql -p port -U username dbname
Try
cat old_db_dump.sql | psql -U db_user_name -d new_db_name
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