Blank Numeric Column For INSERT

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Blank Numeric Column For INSERT
Date: 2011-11-23 18:33:03
Message-ID: alpine.LNX.2.00.1111231025540.28204@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to load 143K rows into a postgres-9.0.5 table from an ASCII
text file. The file consists of INSERT INTO ... statements and the VALUES
are comma delimited. One column is numeric (REAL), but ~10K rows have that
value missing, and postgres rejects the lines.

The column does not have a NOT NULL constraint.

The command line I use is 'psql -d <database_name> -f wq.sql'.

Originally I had two commas in sequence since there were no values between
them. Next I tried a space between the two commas. I tried searching in the
9.0.5 manual for 'missing values', 'missing', and another term I don't
recall but found nothing.

An example:

psql:wq.sql:8121: ERROR: syntax error at or near ","
LINE 1: ...its) VALUES (214,'SW-6','1992-11-25','oil_grease', ,'mg/L');

What is the approprate way to represent the missing column?

TIA,

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AM 2011-11-23 18:46:07 On naming attributes in a WITH clause
Previous Message Chris McDonald 2011-11-23 18:04:14 plpgsql Difference in behaviour between versions?