Re: ignore errors for COPY [solved]

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Vangelis Katsikaros <ibob17(at)yahoo(dot)gr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ignore errors for COPY [solved]
Date: 2010-11-11 18:15:28
Message-ID: 4CDC32C0.1080607@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le 11/11/2010 17:46, Vangelis Katsikaros a écrit :
> On 11/11/2010 03:05 PM, Guillaume Lelarge wrote:
>>
>> You should better look at pgloader which will use COPY to put your data
>> in your table and found the lines in error. Of course, it takes time to
>> detect lines in error. But at least, all "good" lines will be in your
>> table, and all "bad" lines will be in a file, so that you can modify
>> them to inject later.
>>
>>
>
> Hi
>
> Thanks for the answer, indeed it solves the issue.
>

Great.

> Now, I would like to ask a second question (sorry for using the same
> thread :)
>
> I would like to create a specific database on a another location (not in
> "data_directory = '/var/lib/postgresql/8.3/main'" ). I was wondering if
> I have to run
> initdb -D /other/path/
>
> of if there is another way
>

To create another database in another location, you first need to create
a tablespace, and then create a database in that tablespace. For
example, in psql:

CREATE TABLESPACE otherlocation LOCATION '/some/specific/directory';
CREATE DATABASE newdb TABLESPACE otherlocation;

> (for example in mysql I can do the same thing by creating a symlink to
> the other location inside "datadir = /var/lib/mysql" )
>

Don't know MySQL, so can't say :)

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2010-11-11 18:18:04 Re: Schema tool
Previous Message Rob Sargent 2010-11-11 17:58:16 Re: Schema tool