Patch: FORCE_NULL option for copy COPY in CSV mode

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Patch: FORCE_NULL option for copy COPY in CSV mode
Date: 2013-09-29 08:09:12
Message-ID: CAB8KJ=jS-Um4TGwenS5wLUfJK6K4rNOm_V6GRUj+tcKekL2=GQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

This patch implements the following TODO item:

Allow COPY in CSV mode to control whether a quoted zero-length
string is treated as NULL

Currently this is always treated as a zero-length string,
which generates an error when loading into an integer column

Re: [PATCHES] allow CSV quote in NULL
http://archives.postgresql.org/pgsql-hackers/2007-07/msg00905.php

http://wiki.postgresql.org/wiki/Todo#COPY

I had a very definite use-case for this functionality recently while importing
CSV files generated by Oracle, and was somewhat frustrated by the existence
of a FORCE_NOT_NULL option for specific columns, but not one for
FORCE_NULL.

I'll add this to the November commitfest.

Regards

Ian Barwick

Attachment Content-Type Size
copy-force-null-v1.patch application/octet-stream 10.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2013-09-29 08:46:16 Re: review: psql and pset without any arguments
Previous Message Amit Kapila 2013-09-29 06:10:51 Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block