Re: Fwd: Copy out wording - Mailing list pgsql-hackers
From | Bruce Momjian |
---|---|
Subject | Re: Fwd: Copy out wording |
Date | |
Msg-id | 200909172113.n8HLDaV08216@momjian.us Whole thread Raw |
In response to | Re: Fwd: Copy out wording (Magnus Hagander <magnus@hagander.net>) |
Responses |
Re: Fwd: Copy out wording
|
List | pgsql-hackers |
Magnus Hagander wrote: > On Thu, Sep 3, 2009 at 13:31, Andrew Dunstan<andrew@dunslane.net> wrote: > > > > > > Magnus Hagander wrote: > >> > >> Oh, hang on, "the NULL string" refers to the copy parameter? Not a > >> part of the data? I read it as "a string being NULL". Maybe something > >> like "the value of the NULL string parameter" to be overly clear for > >> people like me? :-) > >> > > > > We could change: > > > > ? A NULL is output as the NULL string and is not quoted, while a data value > > ? matching the NULL string is quoted. > > > > > > to > > > > ? A NULL is output as the NULL parameter and is not quoted, while a non-NULL > > data value whose text representation > > ? matches the NULL parameter is quoted. > > > > > > or something similar. Would that be better? > > Yes, much better IMO. I have applied the attached documentation clarification patch, and backpatched it to 8.4.X. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + Index: doc/src/sgml/ref/copy.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v retrieving revision 1.87 diff -c -c -r1.87 copy.sgml *** doc/src/sgml/ref/copy.sgml 5 Sep 2009 23:58:01 -0000 1.87 --- doc/src/sgml/ref/copy.sgml 17 Sep 2009 21:06:59 -0000 *************** *** 550,562 **** <para> The <literal>CSV</> format has no standard way to distinguish a <literal>NULL</> value from an empty string. ! <productname>PostgreSQL</>'s <command>COPY</> handles this by ! quoting. A <literal>NULL</> is output as the <literal>NULL</> ! string and is not quoted, while a data value matching the ! <literal>NULL</> string is quoted. Therefore, using the default ! settings, a <literal>NULL</> is written as an unquoted empty ! string, while an empty string is written with double quotes ! (<literal>""</>). Reading values follows similar rules. You can use <literal>FORCE NOT NULL</> to prevent <literal>NULL</> input comparisons for specific columns. </para> --- 550,559 ---- <para> The <literal>CSV</> format has no standard way to distinguish a <literal>NULL</> value from an empty string. ! <productname>PostgreSQL</>'s <command>COPY</> handles this using ! quoting. A <literal>NULL</> is output as an empty string without ! quotes, while an empty string data value is double-quoted ! (<literal>""</>). Reading values follows similar rules. You can use <literal>FORCE NOT NULL</> to prevent <literal>NULL</> input comparisons for specific columns. </para>
pgsql-hackers by date: