Quoted NULLs with COPY FROM

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Quoted NULLs with COPY FROM
Date: 2006-01-24 01:35:54
Message-ID: CCB89282FCE1024EA3DCE687A96A51640471F34F@ehost010-6.exch010.intermedia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I need to load CSV files that have quotes in data fields that I want to
map to NULLs in the destination table. So if I see ...,"",... that needs
to be mapped to a NULL (in an INTEGER field in this particular case).
Are there any COPY command options that can do that? It seems that PgSQL
COPY expects the NULL to be always unquoted. There is an option (FORCE
NOT NULL) for doing the opposite. How do I specify that the NULLs are
quoted? I am on 8.0.5.

George

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2006-01-24 02:52:36 Does this look ethical to you?
Previous Message Michael Glaesemann 2006-01-24 00:21:32 Re: mac os x compile failure