Import: empty string and expression - Mailing list pgadmin-hackers

From Quan Zongliang
Subject Import: empty string and expression
Date
Msg-id 20090224174304.5BD4.4125B4E5@gmail.com
Whole thread Raw
Responses Re: Import: empty string and expression  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Hi, all

String:
How to distinguish NULL and empty?

In the COPY command, it conside no quoted empty as NULL and quoted ones as empty.
This rule not defined in the CSV standard(RFC4180).
For example:
   A,,B  has three item: 'A', NULL and 'B'
   A,"",B has three item: 'A', empty and 'B'
Should we follow this rule?
I think it is good.

Some code must be rewrited, because I treat both as empty now.
And with wxString, null and empty can't be distiguished.

Expression:
If end users decide to import with INSERT statement, they can define expressions.
(With other cases, only the constants can be used.
The pgLoader support this option. I forgot to support constants.
Thanks Guillaume, he introduced this good tool to me.)
Those ones must has one column and one row.
That is, it must can be valuated by SELECT statement emitted FROM clauses.

Now, I use <column-name> style in the expression.
The delimiter option use this style too. (<TAB> means TAB char.)
Exscaped char is XML-style, & < and > , and so on.
Because I noticed pgAdmin has a option "Show NULL values as <NULL>".
Is it appropriate?

Regards.

-----------------------------------------------
Quan Zongliang
quanzongliang@gmail.com
CIT Japan:  http://www.cit.co.jp
CIT China:  http://www.citbj.com.cn


pgadmin-hackers by date:

Previous
From: Ashesh Vashi
Date:
Subject: Re: PATCH: Update autovacuum (for TOAST-TABLE) to use reloptions, instead of a system catalog
Next
From: Dave Page
Date:
Subject: Re: PATCH: Update autovacuum (for TOAST-TABLE) to use reloptions, instead of a system catalog