9.1
Table Of Contents
Loading Data with psql
Use the psql command \COPY (back slash-COPY) to load data into vPostgres databases. Do not use the psql
COPY FROM or COPY TO command. The COPY FROM (or COPY TO) command must run on the server with superuser
privileges and cannot load data into remote clients such as vPostgres. The \COPY FROM and \COPY TO commands
use the client session to read and write from local files. These commands support relative paths, and use the
psql communication layer to load data to, or from, the server.
For example, the following psql command loads data from a text file, shelterlists.txt, into the vPostgres
database table shelters in the schema rescues.
Querying vPostgres with psql
After you connect to a vPostgres database, you can query the database. For example, using psql, connect to
the database and type the psql command at the database prompt.
You can run SQL script files using the psql -f SQL_script_filename command, where the file named
SQL_script_filename contains a series of SQL commands. Psql reads the file, runs the SQL commands, and exits.
vFabric Postgres Standard Edition User Guide
26 VMware, Inc.