Re: Import: empty string and expression

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Quan Zongliang <quanzongliang(at)gmail(dot)com>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Import: empty string and expression
Date: 2009-02-26 09:06:13
Message-ID: 937d27e10902260106k66899f6en43f1f8a8db778011@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Thu, Feb 26, 2009 at 6:30 AM, Quan Zongliang <quanzongliang(at)gmail(dot)com> wrote:

> With the width-delimiter, user can set empty values by "5,,12" or "5,0,12".
> Should we add NULL-value support? Like: "5,<NULL>,12"

No, I think we should just use:

5,,6 = 5, NULL, 6

and

5,'',6 = 5, EMPTY STRING, 6

> How about other types? boolean, integer, float, and so on.

Well they don't have an 'empty' value anyway, so no value would always
equal NULL.

> This is my idea:
> For String, the user can select one chioce:
>    "empty"     (generate "FORCE NOT NULL" option for COPY or '' for INSERT),
>    "NULL"      (left nochange, for column nullable column)
>    "ERROR"     (don't generate statement, log only).
>    "CONSTANT"  (user-defined string)

Have a set of radio buttons and a textbox perhaps:

NULL AS: NULL O empty string O constant O [ ]

> All of them act on NULL.
> For others:
>    "NULL"      (left nochange)
>    "ERROR"     (don't generate statement, log only).
>    "CONSTANT"  (user-defined string) or
>    [other options depend on type]
> All of them act on NULL or empty.

NULL AS: NULL O constant O [ ]

I wouldn't bother with ERROR for any type - let the server detect
errors and reject data accordingly.

> Until now, I have no idea with array type.

I wouldn't worry about those yet. Let's learn to walk first, and fly later :-)

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Quan Zongliang 2009-02-26 09:17:57 Re: Import: empty string and expression
Previous Message Dave Page 2009-02-26 08:56:26 Re: Import: empty string and expression