Re: INSERTing rows from external file

From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INSERTing rows from external file
Date: 2011-08-16 21:48:55
Message-ID: CAKt_ZfvV2yojq6qCN2tNyO1Ji7mGm=ei_HgmQMy8_WvRWXUNTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 16, 2011 at 2:34 PM, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
>  I have a file with 5500 rows formated as 'INSERT INTO <table>
> (column_names) VALUES <values>;' that I thought I could read using psql from
> the command line. However, the syntax, 'psql <database_name> < filename.sql'
> throws an error at the beginning of the first INSERT statement.

What kind of error?
>
>  In the INSERT manual page I see no example or other insight on adding a
> large number of rows to a table from an external .sql file. Please point me
> to the reference on how to do this.

Do you get the same error by running psql interactively and typing \i
filename.sql?

Best Wishes,
Chris Travers

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2011-08-16 21:51:53 Re: INSERTing rows from external file
Previous Message Greg Smith 2011-08-16 21:43:04 Re: backup-strategies for large databases