Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
On Tue, 16 Aug 2011, David Johnston wrote: Your INSERT statement is syntactically incorrect; the error has nothing to do with PSQL other than the fact that PSQL is reporting the error to you. David, I see that now. Odds are you are wrapping your Boolean input with single quotes and the em

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rich Shepard Sent: Tuesday, August 16, 2011 6:14 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] INSERTing rows from external file On Tue, 16 Aug 2011, Chris

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Scott Ribe
On Aug 16, 2011, at 4:13 PM, Rich Shepard wrote: > Here's the full statement for the last row: > > psql:chem_too.sql:5517: ERROR: invalid input syntax for type boolean: "" > LINE 1: ...NS','1996-11-21','Potassium','0.94988','mg/L','','','','... >

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
On Tue, 16 Aug 2011, Greg Smith wrote: Sounds like a problem with your file. Messing up CR/LF characters when moving things between Windows and UNIX systems is a popular one. Proof it works: Greg, Excel file imported into LibreOffice and converted to .ods. Columns marked and saved as .csv

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
On Tue, 16 Aug 2011, Chris Travers wrote: What kind of error? Chris, Here's the full statement for the last row: psql:chem_too.sql:5517: ERROR: invalid input syntax for type boolean: "" LINE 1: ...NS','1996-11-21','Potassium','0.94988','mg/L','','','','...

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread David Johnston
>> -Original Message- >> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rich Shepard >> Sent: Tuesday, August 16, 2011 5:34 PM >> To: pgsql-general@postgresql.org >> Subject: [GENERAL] INSERTing rows from e

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Greg Smith
On 08/16/2011 05:34 PM, Rich Shepard wrote: I have a file with 5500 rows formated as 'INSERT INTO (column_names) VALUES ;' that I thought I could read using psql from the command line. However, the syntax, 'psql < filename.sql' throws an error at the beginning of the first INSERT statement

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 2:34 PM, Rich Shepard wrote: >  I have a file with 5500 rows formated as 'INSERT INTO > (column_names) VALUES ;' that I thought I could read using psql from > the command line. However, the syntax, 'psql < filename.sql' > throws an error at the beginning of the first INSE

[GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
I have a file with 5500 rows formated as 'INSERT INTO (column_names) VALUES ;' that I thought I could read using psql from the command line. However, the syntax, 'psql < filename.sql' throws an error at the beginning of the first INSERT statement. In the INSERT manual page I see no example