We are switching hosts and the old one provided a sql dump of the postgresql database of our site. Now I'm trying to set this up on a local wamp sever to test this.
The only problem is that i don't have an idea how i can import this database in the postgresql 9 i have set up.
I tried pgAdmin III but i can't seem to find an 'import' function. So i just opened the SQL editor and pasted the contents of the dump there and executed it, it creates the tables but i keeps giving me errors when he tries to put the data in it.
ERROR: syntax error at or near "t"
LINE 474: t 2011-05-24 16:45:01.768633 2011-05-24 16:45:01.768633 view...
The lines:
COPY tb_abilities (active, creation, modtime, id, lang, title, description) FROM stdin;
t 2011-05-24 16:45:01.768633 2011-05-24 16:45:01.768633 view nl ...
I've also tried to this with the command prompt but i can't really find the command that i need.
If I do
psql mydatabase < C:/database/db-backup.sql;
i get the error
ERROR: syntax error at or near "psql"
LINE 1: psql mydatabase < C:/database/db-backu...
^
What's the best way to import the database?
ERROR: syntax error at or near "t"
. It turned out that I had only imported a partial schema and thus aCREATE TABLE
statement earlier in the script had failed. Look through the full output of the import to find it. – owensmartin Aug 10 at 23:26