Sample databases

Started by Tommy Gibbonsover 17 years ago3 messagesgeneral
Jump to latest
#1Tommy Gibbons
tomgig@gmail.com

Hi,
I would like some pointers as to how to install the dbsamples so that I can
use them in Postgres. These .tar.qz files seem to contain *.sql files.
These seem to be text files but I do not understand how to import to
postgres or if there is some command line command to run.

These samples are on
http://www.postgresql.org/ftp/projects/pgFoundry/dbsamples/

Tommy.

In reply to: Tommy Gibbons (#1)
Re: Sample databases

On 29/09/2008 23:03, Tommy Gibbons wrote:

I would like some pointers as to how to install the dbsamples so that I
can use them in Postgres. These .tar.qz files seem to contain *.sql
files. These seem to be text files but I do not understand how to
import to postgres or if there is some command line command to run.

You use psql to load them:

psql -U <user> -f <file> <database>

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

#3David Rowley
dgrowleyml@gmail.com
In reply to: Tommy Gibbons (#1)
Re: Sample databases

Tommy Gibbons wrote:

I would like some pointers as to how to install the dbsamples so that I can

use them in Postgres. These .tar.qz files seem to contain *.sql files.
These seem to be text files but I do not understand how to > import to
postgres or if there is some command line command to run.

These samples are on

http://www.postgresql.org/ftp/projects/pgFoundry/dbsamples/

You can use psql to import .sql files. Once your logged into psql you can \i
<filename> to import the files. Have a look at the other options too with \?

You may wish to create a database before importing the files, see
http://www.postgresql.org/docs/8.3/interactive/sql-createdatabase.html

David.