PostgreSQL: Loading tables from file

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

PostgreSQL: Loading tables from file

Post by myleow »

I have a file call tables.sql that has all my table creation statements in there.

How do i load it into the DB?

Regards
Mian
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

From system prompt....

Code: Select all

cd directory
psql -h <server> <database> <user>
(you can change the directory when you are in the db, but easier outside).

Code: Select all

/i filename
You may also want to look at phppgadmin http://phppgadmin.sourceforge.net/
if you do not already have it.
Post Reply