Forum OpenACS Q&A: Postgres equivalent of SQL*Loader?

Collapse
Posted by Janine Ohmer on
Does Postgres have a bulk upload utility like Oracle's sqlldr?  I
tried to RTFM on postgresql.org, but didn't see anything helpful.  I
figured before I gave up on the idea I'd ask here.

If no such utility exists, how does one upload data into Postgres?

Collapse
Posted by Lamar Owen on
COPY and copy in psql.  Take a look at the result of a pg_dump of a database to get usage.
Collapse
Posted by Roberto Mello on
You use psql to bulk upload stuff. It can be either in SQL or COPY statements. For example, to dump and reload a database:

pg_dump mydb > mydb-2000-06-29.dmp (dumps as COPY statements)
pg_dump -d mydb > mydb-sql-2000-06-29.dmp (dumps as SQL statements)

cat mydb-2000-06-29.dmp > psql mydb
For another example, look at the www/install directory of OpenACS (especially the load-geo-tables script). That's how the counties and countries data is loaded.