Re: creating tables from a disk file

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: creating tables from a disk file
Date: 2002-02-19 16:43:46
Message-ID: m3adu5h16l.fsf@varsoon.denali.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Shepard <rshepard(at)appl-ecosys(dot)com> writes:

> I have created the database schema as a text file. It contains all the
> CREATE TABLE comands with the fields and their constraints. But, I cannot
> find a command that will have postgres accept this file and create the
> tables for me.
>
> The COPY (\copy) commands are only for data and so is INSERT. CREATE TABLE
> does not appear to have an option by which a disk file can be specified.
>
> Is there a way of having the postmaster read the specifications and create
> the tables, or do I re-enter them all from within psql?

A little reading of the docs would have solved your problem. ;)

$ psql -f <file>

or

$ psql
> \i <file>

Is this not what you are looking for?

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Percy 2002-02-19 16:49:51 number of connections to postmaster
Previous Message Tom Lane 2002-02-19 16:41:33 Re: pg_dump correct version?