[MonetDB-users] Bulk-importing boolean columns

Martin Kersten Martin.Kersten at cwi.nl
Mon Oct 17 23:30:37 CEST 2011

On 10/17/11 8:25 PM, Viktor Rosenfeld wrote:
> Hi,
> I need to bulk-import data that was bulk-exported from PostgreSQL. I
> have only limited control over the raw data.
> I'm using the following command:
>    COPY INTO table FROM '/path/to/filename' USING DELIMITERS '\t','\n','';
> This generally works. The problem is boolean data which is exported by
> PostgreSQL using the values "t" and "f" (unquoted). MonetDB expects
> "true" and "false" here. My current work-around is opening the file in
> Vim and substituting the values (%s/\tt\t/\ttrue\t/g and
> %s/\tf\t/\tfalse\t/g).
> Is there a way to make MonetDB accept the original PostgreSQL data?
The easiest solution would be to convert the "t" to "true" before it leaves Postgresql.
Otherwise, you might use the stream editor "sed" or "awk" to make such trivial changes.

regards, Martin

> Cheers,
> Viktor
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> _______________________________________________
> MonetDB-users mailing list
> MonetDB-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-users

More information about the users-list mailing list