Reputation: 139
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.
Upvotes: 5
Views: 22263
Reputation: 1081
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
Upvotes: 13